home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Source / WinTlb / WINBASE.IDL < prev    next >
Text File  |  1997-05-25  |  156KB  |  5,404 lines

  1.  
  2. // Enums
  3.  
  4. // Rights for OpenProcess
  5. typedef enum EPROCESSACCESS {
  6.     PROCESS_TERMINATE        = 0x0001,
  7.     PROCESS_CREATE_THREAD    = 0x0002,
  8.     PROCESS_VM_OPERATION     = 0x0008,
  9.     PROCESS_VM_READ          = 0x0010,
  10.     PROCESS_VM_WRITE         = 0x0020,
  11.     PROCESS_DUP_HANDLE       = 0x0040,
  12.     PROCESS_CREATE_PROCESS   = 0x0080,
  13.     PROCESS_SET_QUOTA        = 0x0100,
  14.     PROCESS_SET_INFORMATION  = 0x0200,
  15.     PROCESS_QUERY_INFORMATION = 0x0400,
  16.     PROCESS_ALL_ACCESS       = 0x001F0FFF
  17. } EPROCESSACCESS;
  18.  
  19. typedef enum EFORMAT_MESSAGE {
  20.     FORMAT_MESSAGE_NONE             = 0x00000000,
  21.     FORMAT_MESSAGE_ALLOCATE_BUFFER  = 0x00000100,
  22.     FORMAT_MESSAGE_IGNORE_INSERTS   = 0x00000200,
  23.     FORMAT_MESSAGE_FROM_STRING      = 0x00000400,
  24.     FORMAT_MESSAGE_FROM_HMODULE     = 0x00000800,
  25.     FORMAT_MESSAGE_FROM_SYSTEM      = 0x00001000,
  26.     FORMAT_MESSAGE_ARGUMENT_ARRAY   = 0x00002000,
  27.     FORMAT_MESSAGE_MAX_WIDTH_MASK   = 0x000000FF
  28. } EFORMAT_MESSAGE;
  29.  
  30. // ShowWindow/WinExec constants
  31. typedef enum ESW {
  32.     [ helpstring("WinExec/ShowWindow: Hide window and activate next window") ]
  33.     SW_HIDE               = 0,
  34.     [ helpstring("WinExec/ShowWindow: Activate window in its current state") ]
  35.     SW_SHOWNORMAL         = 1,
  36.     [ helpstring("WinExec/ShowWindow: Activate window in its current state") ]
  37.     SW_NORMAL             = 1,
  38.     [ helpstring("WinExec/ShowWindow: Activate and minimize window") ]
  39.     SW_SHOWMINIMIZED      = 2,
  40.     [ helpstring("WinExec/ShowWindow: Activate and maximize window") ]
  41.     SW_SHOWMAXIMIZED      = 3,
  42.     [ helpstring("WinExec/ShowWindow: Activate and maximize window") ]
  43.     SW_MAXIMIZE           = 3,
  44.     [ helpstring("WinExec/ShowWindow: Show window in current state, but don't change active window") ]
  45.     SW_SHOWNOACTIVATE     = 4,
  46.     [ helpstring("WinExec/ShowWindow: Show window in current or startup state") ]
  47.     SW_SHOW               = 5,
  48.     [ helpstring("WinExec/ShowWindow: Minimize window and make next window active") ]
  49.     SW_MINIMIZE           = 6,
  50.     [ helpstring("WinExec/ShowWindow: Minimize window, but don't change active window") ]
  51.     SW_SHOWMINNOACTIVE    = 7,
  52.     [ helpstring("WinExec/ShowWindow: Show window in current state, but don't change active window") ]
  53.     SW_SHOWNA             = 8,
  54.     [ helpstring("WinExec/ShowWindow: Make window active, and restore from miminized or maximized state") ]
  55.     SW_RESTORE            = 9,
  56.     [ helpstring("ShowWindow: Show window in startup state") ]
  57.     SW_SHOWDEFAULT        = 10,
  58.     [ helpstring("ShowWindow: Show window in startup state") ]
  59.     SW_MAX                = 10
  60. } ESW;
  61.  
  62. // Structures
  63.  
  64. typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION;
  65.  
  66. typedef struct OVERLAPPED {
  67.     DWORD   Internal;
  68.     DWORD   InternalHigh;
  69.     DWORD   Offset;
  70.     DWORD   OffsetHigh;
  71.     HANDLE  hEvent;
  72. } OVERLAPPED;
  73.  
  74. typedef struct PROCESS_INFORMATION {
  75.     HANDLE hProcess;
  76.     HANDLE hThread;
  77.     DWORD dwProcessId;
  78.     DWORD dwThreadId;
  79. } PROCESS_INFORMATION;
  80.  
  81. typedef long PTHREAD_START_ROUTINE;
  82. typedef long LPTHREAD_START_ROUTINE;
  83.  
  84. /*
  85. typedef RTL_CRITICAL_SECTION CRITICAL_SECTION;
  86. typedef PRTL_CRITICAL_SECTION PCRITICAL_SECTION;
  87. typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION;
  88.  
  89. typedef RTL_CRITICAL_SECTION_DEBUG CRITICAL_SECTION_DEBUG;
  90. typedef PRTL_CRITICAL_SECTION_DEBUG PCRITICAL_SECTION_DEBUG;
  91. typedef PRTL_CRITICAL_SECTION_DEBUG LPCRITICAL_SECTION_DEBUG;
  92.  
  93. typedef PLDT_ENTRY LPLDT_ENTRY;
  94.  
  95. //define MUTEX_MODIFY_STATE MUTANT_QUERY_STATE
  96. //define MUTEX_ALL_ACCESS MUTANT_ALL_ACCESS
  97. */
  98.  
  99. /* Serial not implemented
  100.  
  101. typedef struct COMMPROP {
  102.     WORD wPacketLength;
  103.     WORD wPacketVersion;
  104.     DWORD dwServiceMask;
  105.     DWORD dwReserved1;
  106.     DWORD dwMaxTxQueue;
  107.     DWORD dwMaxRxQueue;
  108.     DWORD dwMaxBaud;
  109.     DWORD dwProvSubType;
  110.     DWORD dwProvCapabilities;
  111.     DWORD dwSettableParams;
  112.     DWORD dwSettableBaud;
  113.     WORD wSettableData;
  114.     WORD wSettableStopParity;
  115.     DWORD dwCurrentTxQueue;
  116.     DWORD dwCurrentRxQueue;
  117.     DWORD dwProvSpec1;
  118.     DWORD dwProvSpec2;
  119.     WCHAR wcProvChar[1];
  120. } COMMPROP;
  121.  
  122. typedef struct DCB {
  123.     DWORD DCBlength;      // sizeof(DCB)
  124.     DWORD BaudRate;       // Baudrate at which running
  125.     DWORD fBinary: 1;     // Binary Mode (skip EOF check)
  126.     DWORD fParity: 1;     // Enable parity checking
  127.     DWORD fOutxCtsFlow:1; // CTS handshaking on output
  128.     DWORD fOutxDsrFlow:1; // DSR handshaking on output
  129.     DWORD fDtrControl:2;  // DTR Flow control
  130.     DWORD fDsrSensitivity:1; // DSR Sensitivity
  131.     DWORD fTXContinueOnXoff: 1; // Continue TX when Xoff sent
  132.     DWORD fOutX: 1;       // Enable output X-ON/X-OFF
  133.     DWORD fInX: 1;        // Enable input X-ON/X-OFF
  134.     DWORD fErrorChar: 1;  // Enable Err Replacement
  135.     DWORD fNull: 1;       // Enable Null stripping
  136.     DWORD fRtsControl:2;  // Rts Flow control
  137.     DWORD fAbortOnError:1; // Abort all reads and writes on Error
  138.     DWORD fDummy2:17;     // Reserved
  139.     WORD wReserved;       // Not currently used
  140.     WORD XonLim;          // Transmit X-ON threshold
  141.     WORD XoffLim;         // Transmit X-OFF threshold
  142.     BYTE ByteSize;        // Number of bits/byte, 4-8
  143.     BYTE Parity;          // 0-4=None,Odd,Even,Mark,Space
  144.     BYTE StopBits;        // 0,1,2 = 1, 1.5, 2
  145.     char XonChar;         // Tx and Rx X-ON character
  146.     char XoffChar;        // Tx and Rx X-OFF character
  147.     char ErrorChar;       // Error replacement char
  148.     char EofChar;         // End of Input character
  149.     char EvtChar;         // Received Event character
  150.     WORD wReserved1;      // Fill for now.
  151. } DCB;
  152.  
  153. typedef struct COMMTIMEOUTS {
  154.     DWORD ReadIntervalTimeout;          // Maximum time between read chars
  155.     DWORD ReadTotalTimeoutMultiplier;   // Multiplier of characters
  156.     DWORD ReadTotalTimeoutConstant;     // Constant in milliseconds
  157.     DWORD WriteTotalTimeoutMultiplier;  // Multiplier of characters
  158.     DWORD WriteTotalTimeoutConstant;    // Constant in milliseconds
  159. } COMMTIMEOUTS;
  160.  
  161. typedef struct COMMCONFIG {
  162.     DWORD dwSize;               // Size of the entire struct
  163.     WORD wVersion;              // version of the structure
  164.     WORD wReserved;             // alignment
  165.     DCB dcb;                    // device control block
  166.     DWORD dwProviderSubType;    // ordinal value for identifying
  167.                                 //   provider-defined data structure format
  168.     DWORD dwProviderOffset;     // Specifies the offset of provider specific
  169.                                 //   data field in bytes from the start
  170.     DWORD dwProviderSize;       // size of the provider-specific data field
  171.     WCHAR wcProviderData[1];    // provider-specific data
  172. } COMMCONFIG;
  173. */
  174.  
  175. typedef struct SYSTEM_INFO {
  176.     // DWORD dwOemId;    // Obsolete, replaced by following:
  177.     WORD wProcessorArchitecture;
  178.     WORD wReserved;
  179.     DWORD dwPageSize;
  180.     LPVOID lpMinimumApplicationAddress;
  181.     LPVOID lpMaximumApplicationAddress;
  182.     DWORD dwActiveProcessorMask;
  183.     DWORD dwNumberOfProcessors;
  184.     DWORD dwProcessorType;
  185.     DWORD dwAllocationGranularity;
  186.     WORD wProcessorLevel;
  187.     WORD wProcessorRevision;
  188. } SYSTEM_INFO;
  189.  
  190. typedef struct MEMORYSTATUS {
  191.     DWORD dwLength;
  192.     DWORD dwMemoryLoad;
  193.     DWORD dwTotalPhys;
  194.     DWORD dwAvailPhys;
  195.     DWORD dwTotalPageFile;
  196.     DWORD dwAvailPageFile;
  197.     DWORD dwTotalVirtual;
  198.     DWORD dwAvailVirtual;
  199. } MEMORYSTATUS;
  200.  
  201. /*
  202. typedef struct EXCEPTION_DEBUG_INFO {
  203.     EXCEPTION_RECORD ExceptionRecord;
  204.     DWORD dwFirstChance;
  205. } EXCEPTION_DEBUG_INFO;
  206.  
  207. typedef struct CREATE_THREAD_DEBUG_INFO {
  208.     HANDLE hThread;
  209.     LPVOID lpThreadLocalBase;
  210.     LPTHREAD_START_ROUTINE lpStartAddress;
  211. } CREATE_THREAD_DEBUG_INFO;
  212.  
  213. typedef struct CREATE_PROCESS_DEBUG_INFO {
  214.     HANDLE hFile;
  215.     HANDLE hProcess;
  216.     HANDLE hThread;
  217.     LPVOID lpBaseOfImage;
  218.     DWORD dwDebugInfoFileOffset;
  219.     DWORD nDebugInfoSize;
  220.     LPVOID lpThreadLocalBase;
  221.     LPTHREAD_START_ROUTINE lpStartAddress;
  222.     LPVOID lpImageName;
  223.     WORD fUnicode;
  224. } CREATE_PROCESS_DEBUG_INFO;
  225.  
  226. typedef struct EXIT_THREAD_DEBUG_INFO {
  227.     DWORD dwExitCode;
  228. } EXIT_THREAD_DEBUG_INFO;
  229.  
  230. typedef struct EXIT_PROCESS_DEBUG_INFO {
  231.     DWORD dwExitCode;
  232. } EXIT_PROCESS_DEBUG_INFO;
  233.  
  234. typedef struct LOAD_DLL_DEBUG_INFO {
  235.     HANDLE hFile;
  236.     LPVOID lpBaseOfDll;
  237.     DWORD dwDebugInfoFileOffset;
  238.     DWORD nDebugInfoSize;
  239.     LPVOID lpImageName;
  240.     WORD fUnicode;
  241. } LOAD_DLL_DEBUG_INFO;
  242.  
  243. typedef struct UNLOAD_DLL_DEBUG_INFO {
  244.     LPVOID lpBaseOfDll;
  245. } UNLOAD_DLL_DEBUG_INFO;
  246.  
  247. typedef struct OUTPUT_DEBUG_STRING_INFO {
  248.     LPTSTR lpDebugStringData;
  249.     WORD fUnicode;
  250.     WORD nDebugStringLength;
  251. } OUTPUT_DEBUG_STRING_INFO;
  252.  
  253. typedef struct RIP_INFO {
  254.     DWORD dwError;
  255.     DWORD dwType;
  256. } RIP_INFO;
  257.  
  258. typedef struct DEBUG_EVENT {
  259.     DWORD dwDebugEventCode;
  260.     DWORD dwProcessId;
  261.     DWORD dwThreadId;
  262.     union {
  263.         EXCEPTION_DEBUG_INFO Exception;
  264.         CREATE_THREAD_DEBUG_INFO CreateThread;
  265.         CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
  266.         EXIT_THREAD_DEBUG_INFO ExitThread;
  267.         EXIT_THREAD_DEBUG_INFO ExitProcess;
  268.         LOAD_DLL_DEBUG_INFO LoadDll;
  269.         UNLOAD_DLL_DEBUG_INFO UnloadDll;
  270.         OUTPUT_DEBUG_STRING_INFO DebugString;
  271.         RIP_INFO RipInfo;
  272.     } u;
  273. } DEBUG_EVENT;
  274.  
  275. typedef struct MEMORY_BASIC_INFORMATION {
  276.     PVOID BaseAddress;
  277.     PVOID AllocationBase;
  278.     DWORD AllocationProtect;
  279.     DWORD RegionSize;
  280.     DWORD State;
  281.     DWORD Protect;
  282.     DWORD Type;
  283. } MEMORY_BASIC_INFORMATION, *PMEMORY_BASIC_INFORMATION;
  284. */
  285.  
  286. /*
  287. typedef PCONTEXT LPCONTEXT;
  288. typedef PEXCEPTION_RECORD LPEXCEPTION_RECORD;
  289. typedef PEXCEPTION_POINTERS LPEXCEPTION_POINTERS;
  290. */
  291.  
  292. typedef struct OFSTRUCT {
  293.     BYTE cBytes;
  294.     BYTE fFixedDisk;
  295.     WORD nErrCode;
  296.     WORD Reserved1;
  297.     WORD Reserved2;
  298. #ifdef UNICODE
  299.     BYTE szPathName[128 * 2]; // OFS_MAXPATHNAME
  300. #else
  301.     BYTE szPathName[128]; // OFS_MAXPATHNAME
  302. #endif
  303. } OFSTRUCT;
  304.  
  305. /*
  306. typedef struct PROCESS_HEAP_ENTRY {
  307.     PVOID lpData;
  308.     DWORD cbData;
  309.     BYTE cbOverhead;
  310.     BYTE iRegionIndex;
  311.     WORD wFlags;
  312.     union {
  313.         struct {
  314.             HANDLE hMem;
  315.             DWORD dwReserved[ 3 ];
  316.         } Block;
  317.         struct {
  318.             DWORD dwCommittedSize;
  319.             DWORD dwUnCommittedSize;
  320.             LPVOID lpFirstBlock;
  321.             LPVOID lpLastBlock;
  322.         } Region;
  323.     };
  324. } PROCESS_HEAP_ENTRY;
  325. */
  326.  
  327. typedef struct BY_HANDLE_FILE_INFORMATION {
  328.     DWORD dwFileAttributes;
  329.     CURRENCY ftCreationTime;
  330.     CURRENCY ftLastAccessTime;
  331.     CURRENCY ftLastWriteTime;
  332.     DWORD dwVolumeSerialNumber;
  333.     DWORD nFileSizeHigh;
  334.     DWORD nFileSizeLow;
  335.     DWORD nNumberOfLinks;
  336.     DWORD nFileIndexHigh;
  337.     DWORD nFileIndexLow;
  338. } BY_HANDLE_FILE_INFORMATION;
  339.  
  340. typedef struct BY_HANDLE_FILE_INFORMATIONO {
  341.     DWORD dwFileAttributes;
  342.     FILETIME ftCreationTime;
  343.     FILETIME ftLastAccessTime;
  344.     FILETIME ftLastWriteTime;
  345.     DWORD dwVolumeSerialNumber;
  346.     DWORD nFileSizeHigh;
  347.     DWORD nFileSizeLow;
  348.     DWORD nNumberOfLinks;
  349.     DWORD nFileIndexHigh;
  350.     DWORD nFileIndexLow;
  351. } BY_HANDLE_FILE_INFORMATIONO;
  352.  
  353. typedef struct TIME_ZONE_INFORMATION {
  354.     LONG Bias;
  355. #ifdef UNICODE
  356.     BYTE StandardName[ 32 * 2 ];
  357.     SYSTEMTIME StandardDate;
  358.     LONG StandardBias;
  359.     BYTE DaylightName[ 32 * 2 ];
  360. #else
  361.     BYTE StandardName[ 32 ];
  362.     SYSTEMTIME StandardDate;
  363.     LONG StandardBias;
  364.     BYTE DaylightName[ 32 ];
  365. #endif
  366.     SYSTEMTIME DaylightDate;
  367.     LONG DaylightBias;
  368. } TIME_ZONE_INFORMATION;
  369.  
  370.  
  371.  
  372. typedef long LPOVERLAPPED_COMPLETION_ROUTINE;
  373. /* VOID (WINAPI *LPOVERLAPPED_COMPLETION_ROUTINE)(
  374.     DWORD dwErrorCode,
  375.     DWORD dwNumberOfBytesTransfered,
  376.     LPOVERLAPPED lpOverlapped);
  377. */
  378.  
  379. /*
  380. typedef struct WIN32_STREAM_ID {
  381.         DWORD          dwStreamId ;
  382.         DWORD          dwStreamAttributes ;
  383.         LARGE_INTEGER  Size ;
  384.         DWORD          dwStreamNameSize ;
  385.         WCHAR          cStreamName[ ANYSIZE_ARRAY ] ;
  386. } WIN32_STREAM_ID;
  387. */
  388.  
  389. typedef struct STARTUPINFO {
  390.     DWORD   cb;
  391.     BSTR    lpReserved;
  392.     BSTR    lpDesktop;
  393.     BSTR    lpTitle;
  394.     // LONG /* BSTR */ lpReserved;
  395.     // LONG /* BSTR */ lpDesktop;
  396.     // LONG /* BSTR */ lpTitle;
  397.     DWORD   dwX;
  398.     DWORD   dwY;
  399.     DWORD   dwXSize;
  400.     DWORD   dwYSize;
  401.     DWORD   dwXCountChars;
  402.     DWORD   dwYCountChars;
  403.     DWORD   dwFillAttribute;
  404.     DWORD   dwFlags;
  405.     ESW     wShowWindow;
  406.     // WORD    wShowWindow;
  407.     // WORD    cbReserved2;
  408.     LONG /* BYTE * */ lpReserved2;
  409.     HANDLE  hStdInput;
  410.     HANDLE  hStdOutput;
  411.     HANDLE  hStdError;
  412. } STARTUPINFO;
  413.  
  414. typedef struct WIN32_FIND_DATA {
  415.     DWORD dwFileAttributes;
  416.     CURRENCY ftCreationTime;
  417.     CURRENCY ftLastAccessTime;
  418.     CURRENCY ftLastWriteTime;
  419.     DWORD nFileSizeHigh;
  420.     DWORD nFileSizeLow;
  421.     DWORD dwReserved0;
  422.     DWORD dwReserved1;
  423. #ifdef UNICODE
  424.     BYTE cFileName[260 * 2];
  425.     BYTE cAlternateFileName[14 * 2];
  426. #else
  427.     BYTE cFileName[260];
  428.     BYTE cAlternateFileName[14];
  429. #endif
  430. } WIN32_FIND_DATA;
  431.  
  432. typedef struct WIN32_FIND_DATAO {
  433.     DWORD dwFileAttributes;
  434.     FILETIME ftCreationTime;
  435.     FILETIME ftLastAccessTime;
  436.     FILETIME ftLastWriteTime;
  437.     DWORD nFileSizeHigh;
  438.     DWORD nFileSizeLow;
  439.     DWORD dwReserved0;
  440.     DWORD dwReserved1;
  441. #ifdef UNICODE
  442.     BYTE cFileName[260 * 2];
  443.     BYTE cAlternateFileName[14 * 2];
  444. #else
  445.     BYTE cFileName[260];
  446.     BYTE cAlternateFileName[14];
  447. #endif
  448. } WIN32_FIND_DATAO;
  449.  
  450. typedef long ENUMRESTYPEPROC;
  451. typedef long ENUMRESNAMEPROC;
  452. typedef long ENUMRESLANGPROC;
  453.  
  454. // LASTTYPE
  455. typedef struct OSVERSIONINFO {
  456.     DWORD dwOSVersionInfoSize;
  457.     DWORD dwMajorVersion;
  458.     DWORD dwMinorVersion;
  459.     DWORD dwBuildNumber;
  460.     DWORD dwPlatformId;
  461. #ifdef UNICODE
  462.     BYTE szCSDVersion[128 * 2];    // Maintenance string for PSS usage
  463. #else
  464.     BYTE szCSDVersion[128];     // Maintenance string for PSS usage
  465. #endif
  466. } OSVERSIONINFO;
  467.  
  468. /*
  469. typedef struct SYSTEM_POWER_STATUS {
  470.     BYTE ACLineStatus;
  471.     BYTE BatteryFlag;
  472.     BYTE BatteryLifePercent;
  473.     BYTE Reserved1;
  474.     DWORD BatteryLifeTime;
  475.     DWORD BatteryFullLifeTime;
  476. } SYSTEM_POWER_STATUS;
  477. */
  478.  
  479. typedef enum EFILE_NOTIFY {
  480.     FILE_NOTIFY_CHANGE_FILE_NAME  = 0x00000001,
  481.     FILE_NOTIFY_CHANGE_DIR_NAME   = 0x00000002,
  482.     FILE_NOTIFY_CHANGE_ATTRIBUTES = 0x00000004,
  483.     FILE_NOTIFY_CHANGE_SIZE       = 0x00000008,
  484.     FILE_NOTIFY_CHANGE_LAST_WRITE = 0x00000010,
  485.     FILE_NOTIFY_CHANGE_SECURITY   = 0x00000100
  486. } EFILE_NOTIFY;
  487.  
  488. [
  489. #ifdef UNICODE
  490. uuid(64675049-3A82-101B-8181-00AA003743D3),
  491. #else
  492. uuid(64674049-3A82-101B-8181-00AA003743D3),
  493. #endif
  494. helpstring("Win32 Base Constants"),
  495. dllname("NOSUCH.DLL")
  496. ]
  497. module WinBaseConst {
  498.  
  499.     [ helpstring("Multiplier for removing extra decimal places from integers stored as Currency") ]
  500.     const DWORD CURRENCY_MULTIPLIER        = 10000;
  501.  
  502.     const DWORD OWNER_SECURITY_INFORMATION  = 0x00000001;
  503.     const DWORD GROUP_SECURITY_INFORMATION  = 0x00000002;
  504.     const DWORD DACL_SECURITY_INFORMATION   = 0x00000004;
  505.     const DWORD SACL_SECURITY_INFORMATION   = 0x00000008;
  506.  
  507.     [ helpstring("Invalid handle") ]
  508.     const long INVALID_HANDLE_VALUE  = -1;
  509.     [ helpstring("Invalid file handle") ]
  510.     const long HFILE_INVALID = -1;
  511.     [ helpstring("Invalid handle") ]
  512.     const long hInvalid = -1;
  513.     [ helpstring("Null handle") ]
  514.     const long hNull = 0;
  515.     [ helpstring("Invalid file size") ]
  516.     const long INVALID_FILE_SIZE = 0xFFFFFFFF;
  517.     [ helpstring("Invalid attributee") ]
  518.     const long INVALID_ATTRIBUTE = 0xFFFFFFFF;
  519.  
  520.     const int FILE_BEGIN          = 0;
  521.     const int FILE_CURRENT        = 1;
  522.     const int FILE_END            = 2;
  523.  
  524.     const DWORD TIME_ZONE_ID_INVALID = 0xFFFFFFFF;
  525.  
  526.     const long WAIT_FAILED          = 0xFFFFFFFF;
  527.     const long WAIT_OBJECT_0        = 0x00000000;
  528.  
  529.     const long WAIT_ABANDONED       = 0x00000080;
  530.     const long WAIT_ABANDONED_0     = 0x00000080;
  531.  
  532.     const long WAIT_TIMEOUT         = 0x00000102;
  533.     const long WAIT_IO_COMPLETION   = 0x000000C0;
  534.     const long STILL_ACTIVE         = 0x00000103;
  535.  
  536.     //define EXCEPTION_ACCESS_VIOLATION          STATUS_ACCESS_VIOLATION
  537.     //define EXCEPTION_DATATYPE_MISALIGNMENT     STATUS_DATATYPE_MISALIGNMENT
  538.     //define EXCEPTION_BREAKPOINT                STATUS_BREAKPOINT
  539.     //define EXCEPTION_SINGLE_STEP               STATUS_SINGLE_STEP
  540.     //define EXCEPTION_ARRAY_BOUNDS_EXCEEDED     STATUS_ARRAY_BOUNDS_EXCEEDED
  541.     //define EXCEPTION_FLT_DENORMAL_OPERAND      STATUS_FLOAT_DENORMAL_OPERAND
  542.     //define EXCEPTION_FLT_DIVIDE_BY_ZERO        STATUS_FLOAT_DIVIDE_BY_ZERO
  543.     //define EXCEPTION_FLT_INEXACT_RESULT        STATUS_FLOAT_INEXACT_RESULT
  544.     //define EXCEPTION_FLT_INVALID_OPERATION     STATUS_FLOAT_INVALID_OPERATION
  545.     //define EXCEPTION_FLT_OVERFLOW              STATUS_FLOAT_OVERFLOW
  546.     //define EXCEPTION_FLT_STACK_CHECK           STATUS_FLOAT_STACK_CHECK
  547.     //define EXCEPTION_FLT_UNDERFLOW             STATUS_FLOAT_UNDERFLOW
  548.     //define EXCEPTION_INT_DIVIDE_BY_ZERO        STATUS_INTEGER_DIVIDE_BY_ZERO
  549.     //define EXCEPTION_INT_OVERFLOW              STATUS_INTEGER_OVERFLOW
  550.     //define EXCEPTION_PRIV_INSTRUCTION          STATUS_PRIVILEGED_INSTRUCTION
  551.     //define EXCEPTION_IN_PAGE_ERROR             STATUS_IN_PAGE_ERROR
  552.     //define EXCEPTION_ILLEGAL_INSTRUCTION       STATUS_ILLEGAL_INSTRUCTION
  553.     //define EXCEPTION_NONCONTINUABLE_EXCEPTION  STATUS_NONCONTINUABLE_EXCEPTION
  554.     //define EXCEPTION_STACK_OVERFLOW            STATUS_STACK_OVERFLOW
  555.     //define EXCEPTION_INVALID_DISPOSITION       STATUS_INVALID_DISPOSITION
  556.     //define EXCEPTION_GUARD_PAGE                STATUS_GUARD_PAGE_VIOLATION
  557.     //define CONTROL_C_EXIT                      STATUS_CONTROL_C_EXIT
  558.  
  559.     // File creation flags must start at the high end since they
  560.     // are combined with the attributes
  561.  
  562.     const long FILE_FLAG_WRITE_THROUGH      = 0x80000000;
  563.     const long FILE_FLAG_OVERLAPPED         = 0x40000000;
  564.     const long FILE_FLAG_NO_BUFFERING       = 0x20000000;
  565.     const long FILE_FLAG_RANDOM_ACCESS      = 0x10000000;
  566.     const long FILE_FLAG_SEQUENTIAL_SCAN    = 0x08000000;
  567.     const long FILE_FLAG_DELETE_ON_CLOSE    = 0x04000000;
  568.     const long FILE_FLAG_BACKUP_SEMANTICS   = 0x02000000;
  569.     const long FILE_FLAG_POSIX_SEMANTICS    = 0x01000000;
  570.  
  571.     const long CREATE_NEW           = 1;
  572.     const long CREATE_ALWAYS        = 2;
  573.     const long OPEN_EXISTING        = 3;
  574.     const long OPEN_ALWAYS          = 4;
  575.     const long TRUNCATE_EXISTING    = 5;
  576.  
  577.     // Define the NamedPipe definitions
  578.  
  579.     // Define the dwOpenMode values for CreateNamedPipe
  580.  
  581.     const DWORD PIPE_ACCESS_INBOUND        = 0x00000001;
  582.     const DWORD PIPE_ACCESS_OUTBOUND       = 0x00000002;
  583.     const DWORD PIPE_ACCESS_DUPLEX         = 0x00000003;
  584.  
  585.     // Define the Named Pipe End flags for GetNamedPipeInfo
  586.  
  587.     const DWORD PIPE_CLIENT_END            = 0x00000000;
  588.     const DWORD PIPE_SERVER_END            = 0x00000001;
  589.  
  590.     // Define the dwPipeMode values for CreateNamedPipe
  591.  
  592.     const DWORD PIPE_WAIT                  = 0x00000000;
  593.     const DWORD PIPE_NOWAIT                = 0x00000001;
  594.     const DWORD PIPE_READMODE_BYTE         = 0x00000000;
  595.     const DWORD PIPE_READMODE_MESSAGE      = 0x00000002;
  596.     const DWORD PIPE_TYPE_BYTE             = 0x00000000;
  597.     const DWORD PIPE_TYPE_MESSAGE          = 0x00000004;
  598.  
  599.     // Define the well known values for CreateNamedPipe nMaxInstances
  600.  
  601.     const int PIPE_UNLIMITED_INSTANCES   = 255;
  602.  
  603.     //
  604.     // Define the Security Quality of Service bits to be passed
  605.     // into CreateFile
  606.     //
  607.  
  608.     //define SECURITY_ANONYMOUS         ( 0 << 16 )
  609.     //define SECURITY_IDENTIFICATION    ( 1 << 16 )
  610.     //define SECURITY_IMPERSONATION     ( 2 << 16 )
  611.     //define SECURITY_DELEGATION        ( 3 << 16 )
  612.  
  613.     const DWORD SECURITY_CONTEXT_TRACKING  = 0x00040000;
  614.     const DWORD SECURITY_EFFECTIVE_ONLY    = 0x00080000;
  615.  
  616.     const DWORD SECURITY_SQOS_PRESENT      = 0x00100000;
  617.     const DWORD SECURITY_VALID_SQOS_FLAGS  = 0x001F0000;
  618.  
  619.     /* Serial not implemented
  620.  
  621.     // Serial provider type.
  622.  
  623.     //define SP_SERIALCOMM    ((DWORD)0x00000001)
  624.  
  625.     //
  626.     // Provider SubTypes
  627.     //
  628.  
  629.     //define PST_UNSPECIFIED      ((DWORD)0x00000000)
  630.     //define PST_RS232            ((DWORD)0x00000001)
  631.     //define PST_PARALLELPORT     ((DWORD)0x00000002)
  632.     //define PST_RS422            ((DWORD)0x00000003)
  633.     //define PST_RS423            ((DWORD)0x00000004)
  634.     //define PST_RS449            ((DWORD)0x00000005)
  635.     //define PST_MODEM            ((DWORD)0x00000006)
  636.     //define PST_FAX              ((DWORD)0x00000021)
  637.     //define PST_SCANNER          ((DWORD)0x00000022)
  638.     //define PST_NETWORK_BRIDGE   ((DWORD)0x00000100)
  639.     //define PST_LAT              ((DWORD)0x00000101)
  640.     //define PST_TCPIP_TELNET     ((DWORD)0x00000102)
  641.     //define PST_X25              ((DWORD)0x00000103)
  642.  
  643.  
  644.     //
  645.     // Provider capabilities flags.
  646.     //
  647.  
  648.     //define PCF_DTRDSR        ((DWORD)0x0001)
  649.     //define PCF_RTSCTS        ((DWORD)0x0002)
  650.     //define PCF_RLSD          ((DWORD)0x0004)
  651.     //define PCF_PARITY_CHECK  ((DWORD)0x0008)
  652.     //define PCF_XONXOFF       ((DWORD)0x0010)
  653.     //define PCF_SETXCHAR      ((DWORD)0x0020)
  654.     //define PCF_TOTALTIMEOUTS ((DWORD)0x0040)
  655.     //define PCF_INTTIMEOUTS   ((DWORD)0x0080)
  656.     //define PCF_SPECIALCHARS  ((DWORD)0x0100)
  657.     //define PCF_16BITMODE     ((DWORD)0x0200)
  658.  
  659.     //
  660.     // Comm provider settable parameters.
  661.     //
  662.  
  663.     //define SP_PARITY         ((DWORD)0x0001)
  664.     //define SP_BAUD           ((DWORD)0x0002)
  665.     //define SP_DATABITS       ((DWORD)0x0004)
  666.     //define SP_STOPBITS       ((DWORD)0x0008)
  667.     //define SP_HANDSHAKING    ((DWORD)0x0010)
  668.     //define SP_PARITY_CHECK   ((DWORD)0x0020)
  669.     //define SP_RLSD           ((DWORD)0x0040)
  670.  
  671.     //
  672.     // Settable baud rates in the provider.
  673.     //
  674.  
  675.     //define BAUD_075          ((DWORD)0x00000001)
  676.     //define BAUD_110          ((DWORD)0x00000002)
  677.     //define BAUD_134_5        ((DWORD)0x00000004)
  678.     //define BAUD_150          ((DWORD)0x00000008)
  679.     //define BAUD_300          ((DWORD)0x00000010)
  680.     //define BAUD_600          ((DWORD)0x00000020)
  681.     //define BAUD_1200         ((DWORD)0x00000040)
  682.     //define BAUD_1800         ((DWORD)0x00000080)
  683.     //define BAUD_2400         ((DWORD)0x00000100)
  684.     //define BAUD_4800         ((DWORD)0x00000200)
  685.     //define BAUD_7200         ((DWORD)0x00000400)
  686.     //define BAUD_9600         ((DWORD)0x00000800)
  687.     //define BAUD_14400        ((DWORD)0x00001000)
  688.     //define BAUD_19200        ((DWORD)0x00002000)
  689.     //define BAUD_38400        ((DWORD)0x00004000)
  690.     //define BAUD_56K          ((DWORD)0x00008000)
  691.     //define BAUD_128K         ((DWORD)0x00010000)
  692.     //define BAUD_115200       ((DWORD)0x00020000)
  693.     //define BAUD_57600        ((DWORD)0x00040000)
  694.     //define BAUD_USER         ((DWORD)0x10000000)
  695.  
  696.     //
  697.     // Settable Data Bits
  698.     //
  699.  
  700.     //define DATABITS_5        ((WORD)0x0001)
  701.     //define DATABITS_6        ((WORD)0x0002)
  702.     //define DATABITS_7        ((WORD)0x0004)
  703.     //define DATABITS_8        ((WORD)0x0008)
  704.     //define DATABITS_16       ((WORD)0x0010)
  705.     //define DATABITS_16X      ((WORD)0x0020)
  706.  
  707.     //
  708.     // Settable Stop and Parity bits.
  709.     //
  710.  
  711.     //define STOPBITS_10       ((WORD)0x0001)
  712.     //define STOPBITS_15       ((WORD)0x0002)
  713.     //define STOPBITS_20       ((WORD)0x0004)
  714.     //define PARITY_NONE       ((WORD)0x0100)
  715.     //define PARITY_ODD        ((WORD)0x0200)
  716.     //define PARITY_EVEN       ((WORD)0x0400)
  717.     //define PARITY_MARK       ((WORD)0x0800)
  718.     //define PARITY_SPACE      ((WORD)0x1000)
  719.  
  720.     //
  721.     // DTR Control Flow Values.
  722.     //
  723.     //define DTR_CONTROL_DISABLE    0x00
  724.     //define DTR_CONTROL_ENABLE     0x01
  725.     //define DTR_CONTROL_HANDSHAKE  0x02
  726.  
  727.     //
  728.     // RTS Control Flow Values
  729.     //
  730.     //define RTS_CONTROL_DISABLE    0x00
  731.     //define RTS_CONTROL_ENABLE     0x01
  732.     //define RTS_CONTROL_HANDSHAKE  0x02
  733.     //define RTS_CONTROL_TOGGLE     0x03
  734.  
  735.     */
  736.  
  737.     const DWORD PAGE_NOACCESS            = 0x00000001;
  738.     [ helpstring("File mapping: Read-only access to committed pages") ]
  739.     const DWORD PAGE_READONLY            = 0x00000002;
  740.     [ helpstring("File mapping: Read-write access to committed pages") ]
  741.     const DWORD PAGE_READWRITE           = 0x00000004;
  742.     [ helpstring("File mapping: Copy-on-write access to committed pages") ]
  743.     const DWORD PAGE_WRITECOPY           = 0x00000008;
  744.     const DWORD PAGE_EXECUTE             = 0x00000010;
  745.     const DWORD PAGE_EXECUTE_READ        = 0x00000020;
  746.     const DWORD PAGE_EXECUTE_READWRITE   = 0x00000040;
  747.     const DWORD PAGE_EXECUTE_WRITECOPY   = 0x00000080;
  748.     const DWORD PAGE_GUARD               = 0x00000100;
  749.     const DWORD PAGE_NOCACHE             = 0x00000200;
  750.     const DWORD MEM_COMMIT               = 0x00001000;
  751.     const DWORD MEM_RESERVE              = 0x00002000;
  752.     const DWORD MEM_DECOMMIT             = 0x00004000;
  753.     const DWORD MEM_RELEASE              = 0x00008000;
  754.     const DWORD MEM_FREE                 = 0x00010000;
  755.     const DWORD MEM_PRIVATE              = 0x00020000;
  756.     const DWORD MEM_MAPPED               = 0x00040000;
  757.     const DWORD MEM_TOP_DOWN             = 0x00100000;
  758.     const DWORD SEC_FILE                 = 0x00800000;
  759.     const DWORD SEC_IMAGE                = 0x01000000;
  760.     const DWORD SEC_RESERVE              = 0x04000000;
  761.     const DWORD SEC_COMMIT               = 0x08000000;
  762.     const DWORD SEC_NOCACHE              = 0x10000000;
  763.     const DWORD MEM_IMAGE                = 0x01000000;
  764.  
  765.     // Win32 compatibility macros
  766.     //define GlobalDiscard( h )     GlobalReAlloc( (h), 0, GMEM_MOVEABLE )
  767.     //define FreeModule(hLibModule) FreeLibrary((hLibModule))
  768.  
  769.     // Global Memory Flags
  770.  
  771.     [ helpstring("Fixed memory flag for GlobalAlloc") ]
  772.     const UINT GMEM_FIXED       = 0x0000;
  773.     [ helpstring("Moveable memory flag for GlobalAlloc") ]
  774.     const UINT GMEM_MOVEABLE        = 0x0002;
  775.     [ helpstring("No compact memory flag for GlobalAlloc") ]
  776.     const UINT GMEM_NOCOMPACT   = 0x0010;
  777.     [ helpstring("No discard memory flag for GlobalAlloc") ]
  778.     const UINT GMEM_NODISCARD   = 0x0020;
  779.     [ helpstring("Zero init memory flag for GlobalAlloc") ]
  780.     const UINT GMEM_ZEROINIT        = 0x0040;
  781.     [ helpstring("Modify memory flag for GlobalAlloc") ]
  782.     const UINT GMEM_MODIFY      = 0x0080;
  783.     [ helpstring("Discardable memory flag for GlobalAlloc and GlobalFlags") ]
  784.     const UINT GMEM_DISCARDABLE = 0x0100;
  785.     [ helpstring("Shared memory flag for GlobalAlloc") ]
  786.     const UINT GMEM_SHARE       = 0x2000;
  787.     [ helpstring("Fixed memory flag for GlobalAlloc") ]
  788.     const UINT GMEM_NOTIFY      = 0x4000;
  789.     [ helpstring("Notification memory flag for GlobalAlloc") ]
  790.     const UINT GMEM_LOWER       = 0x1000;
  791.  
  792.     const UINT GMEM_NOT_BANKED    = 0x1000;
  793.     const UINT GMEM_DDESHARE      = 0x2000;
  794.     const UINT GMEM_VALID_FLAGS   = 0x7F72;
  795.     const UINT GMEM_INVALID_HANDLE = 0x8000;
  796.  
  797.     const UINT GHND             =  0x0042; // GMEM_MOVEABLE | GMEM_ZEROINIT
  798.     [ helpstring("Fixed and zero init memory flag for GlobalAlloc") ]
  799.     const UINT GPTR             =  0x0040; // GMEM_FIXED | GMEM_ZEROINIT
  800.  
  801.     //define GlobalLRUNewest( h )    (HANDLE)(h)
  802.     //define GlobalLRUOldest( h )    (HANDLE)(h)
  803.     //define GlobalDiscard( h )      GlobalReAlloc( (h), 0, GMEM_MOVEABLE )
  804.  
  805.     // Flags returned by GlobalFlags (in addition to GMEM_DISCARDABLE)
  806.     [ helpstring("Discarded flag from GlobalFlags") ]
  807.     const UINT GMEM_DISCARDED   = 0x4000;
  808.     [ helpstring("Lock count flag from GlobalFlags") ]
  809.     const UINT GMEM_LOCKCOUNT   = 0x00FF;
  810.  
  811.     /* Local Memory Flags not implemented
  812.     const UINT LMEM_FIXED          = 0x0000;
  813.     const UINT LMEM_MOVEABLE       = 0x0002;
  814.     const UINT LMEM_NOCOMPACT      = 0x0010;
  815.     const UINT LMEM_NODISCARD      = 0x0020;
  816.     const UINT LMEM_ZEROINIT       = 0x0040;
  817.     const UINT LMEM_MODIFY         = 0x0080;
  818.     const UINT LMEM_DISCARDABLE    = 0x0F00;
  819.     const UINT LMEM_VALID_FLAGS    = 0x0F72;
  820.     const UINT LMEM_INVALID_HANDLE = 0x8000;
  821.  
  822.     const UINT LHND                = 0x0042; // LMEM_MOVEABLE | LMEM_ZEROINIT
  823.     const UINT LPTR                = 0x0040; // LMEM_FIXED | LMEM_ZEROINIT
  824.  
  825.     const UINT NONZEROLHND         = 0x0002; // LMEM_MOVEABLE
  826.     const UINT NONZEROLPTR         = 0x0000; // LMEM_FIXED
  827.  
  828.     //define LocalDiscard( h )   LocalReAlloc( (h), 0, LMEM_MOVEABLE )
  829.  
  830.     // Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE)
  831.     const UINT LMEM_DISCARDED      = 0x4000;
  832.     const UINT LMEM_LOCKCOUNT      = 0x00FF;
  833.     */
  834.  
  835.     // dwCreationFlag values
  836.  
  837.     const DWORD DEBUG_PROCESS              = 0x00000001;
  838.     const DWORD DEBUG_ONLY_THIS_PROCESS    = 0x00000002;
  839.  
  840.     const DWORD CREATE_SUSPENDED           = 0x00000004;
  841.  
  842.     const DWORD DETACHED_PROCESS           = 0x00000008;
  843.  
  844.     const DWORD CREATE_NEW_CONSOLE         = 0x00000010;
  845.  
  846.     const DWORD NORMAL_PRIORITY_CLASS      = 0x00000020;
  847.     const DWORD IDLE_PRIORITY_CLASS        = 0x00000040;
  848.     const DWORD HIGH_PRIORITY_CLASS        = 0x00000080;
  849.     const DWORD REALTIME_PRIORITY_CLASS    = 0x00000100;
  850.  
  851.     const DWORD CREATE_NEW_PROCESS_GROUP   = 0x00000200;
  852.     const DWORD CREATE_UNICODE_ENVIRONMENT = 0x00000400;
  853.  
  854.     const DWORD CREATE_SEPARATE_WOW_VDM    = 0x00000800;
  855.  
  856.     const DWORD CREATE_DEFAULT_ERROR_MODE  = 0x04000000;
  857.     const DWORD CREATE_NO_WINDOW           = 0x08000000;
  858.  
  859.     //define THREAD_PRIORITY_LOWEST         THREAD_BASE_PRIORITY_MIN
  860.     //define THREAD_PRIORITY_BELOW_NORMAL   (THREAD_PRIORITY_LOWEST+1)
  861.     //define THREAD_PRIORITY_NORMAL         0
  862.     //define THREAD_PRIORITY_HIGHEST        THREAD_BASE_PRIORITY_MAX
  863.     //define THREAD_PRIORITY_ABOVE_NORMAL   (THREAD_PRIORITY_HIGHEST-1)
  864.     //define THREAD_PRIORITY_ERROR_RETURN   (MAXLONG)
  865.  
  866.     //define THREAD_PRIORITY_TIME_CRITICAL  THREAD_BASE_PRIORITY_LOWRT
  867.     //define THREAD_PRIORITY_IDLE           THREAD_BASE_PRIORITY_IDLE
  868.  
  869.     /*
  870.     // Debug APIs
  871.     //
  872.     const int EXCEPTION_DEBUG_EVENT      = 1;
  873.     const int CREATE_THREAD_DEBUG_EVENT  = 2;
  874.     const int CREATE_PROCESS_DEBUG_EVENT = 3;
  875.     const int EXIT_THREAD_DEBUG_EVENT    = 4;
  876.     const int EXIT_PROCESS_DEBUG_EVENT   = 5;
  877.     const int LOAD_DLL_DEBUG_EVENT       = 6;
  878.     const int UNLOAD_DLL_DEBUG_EVENT     = 7;
  879.     const int OUTPUT_DEBUG_STRING_EVENT  = 8;
  880.     const int RIP_EVENT                  = 9;
  881.     */
  882.  
  883.     // GetDriveType return values
  884.     [ helpstring("GetDriveType: Unknown drive") ]
  885.     const int DRIVE_UNKNOWN     = 0;
  886.     [ helpstring("GetDriveType: Invalid root drive") ]
  887.     const int DRIVE_NO_ROOT_DIR = 1;
  888.     [ helpstring("GetDriveType: Removable drive") ]
  889.     const int DRIVE_REMOVABLE   = 2;
  890.     [ helpstring("GetDriveType: Fixed drive") ]
  891.     const int DRIVE_FIXED       = 3;
  892.     [ helpstring("GetDriveType: Remote drive") ]
  893.     const int DRIVE_REMOTE      = 4;
  894.     [ helpstring("GetDriveType: CD-ROM drive") ]
  895.     const int DRIVE_CDROM       = 5;
  896.     [ helpstring("GetDriveType: RAM disk") ]
  897.     const int DRIVE_RAMDISK     = 6;
  898.  
  899.     //define GetFreeSpace(w)                 (0x100000L)
  900.  
  901.     const WORD FILE_TYPE_UNKNOWN  = 0x0000;
  902.     const WORD FILE_TYPE_DISK     = 0x0001;
  903.     const WORD FILE_TYPE_CHAR     = 0x0002;
  904.     const WORD FILE_TYPE_PIPE     = 0x0003;
  905.     const WORD FILE_TYPE_REMOTE   = 0x8000;
  906.  
  907.  
  908.     const DWORD STD_INPUT_HANDLE    = -10;
  909.     const DWORD STD_OUTPUT_HANDLE   = -11;
  910.     const DWORD STD_ERROR_HANDLE    = -12;
  911.  
  912.     //define NOPARITY            0
  913.     //define ODDPARITY           1
  914.     //define EVENPARITY          2
  915.     //define MARKPARITY          3
  916.     //define SPACEPARITY         4
  917.  
  918.     //define ONESTOPBIT          0
  919.     //define ONE5STOPBITS        1
  920.     //define TWOSTOPBITS         2
  921.  
  922.     //define IGNORE              0       // Ignore signal
  923.     //define INFINITE            0xFFFFFFFF  // Infinite timeout
  924.  
  925.     //
  926.     // Basud rates at which the communication device operates
  927.     //
  928.  
  929.     //define CBR_110             110
  930.     //define CBR_300             300
  931.     //define CBR_600             600
  932.     //define CBR_1200            1200
  933.     //define CBR_2400            2400
  934.     //define CBR_4800            4800
  935.     //define CBR_9600            9600
  936.     //define CBR_14400           14400
  937.     //define CBR_19200           19200
  938.     //define CBR_38400           38400
  939.     //define CBR_56000           56000
  940.     //define CBR_57600           57600
  941.     //define CBR_115200          115200
  942.     //define CBR_128000          128000
  943.     //define CBR_256000          256000
  944.  
  945.     //
  946.     // Error Flags
  947.     //
  948.  
  949.     //define CE_RXOVER           0x0001  // Receive Queue overflow
  950.     //define CE_OVERRUN          0x0002  // Receive Overrun Error
  951.     //define CE_RXPARITY         0x0004  // Receive Parity Error
  952.     //define CE_FRAME            0x0008  // Receive Framing error
  953.     //define CE_BREAK            0x0010  // Break Detected
  954.     //define CE_TXFULL           0x0100  // TX Queue is full
  955.     //define CE_PTO              0x0200  // LPTx Timeout
  956.     //define CE_IOE              0x0400  // LPTx I/O Error
  957.     //define CE_DNS              0x0800  // LPTx Device not selected
  958.     //define CE_OOP              0x1000  // LPTx Out-Of-Paper
  959.     //define CE_MODE             0x8000  // Requested mode unsupported
  960.  
  961.     //define IE_BADID            (-1)    // Invalid or unsupported id
  962.     //define IE_OPEN             (-2)    // Device Already Open
  963.     //define IE_NOPEN            (-3)    // Device Not Open
  964.     //define IE_MEMORY           (-4)    // Unable to allocate queues
  965.     //define IE_DEFAULT          (-5)    // Error in default parameters
  966.     //define IE_HARDWARE         (-10)   // Hardware Not Present
  967.     //define IE_BYTESIZE         (-11)   // Illegal Byte Size
  968.     //define IE_BAUDRATE         (-12)   // Unsupported BaudRate
  969.  
  970.     //
  971.     // Events
  972.     //
  973.  
  974.     //define EV_RXCHAR           0x0001  // Any Character received
  975.     //define EV_RXFLAG           0x0002  // Received certain character
  976.     //define EV_TXEMPTY          0x0004  // Transmitt Queue Empty
  977.     //define EV_CTS              0x0008  // CTS changed state
  978.     //define EV_DSR              0x0010  // DSR changed state
  979.     //define EV_RLSD             0x0020  // RLSD changed state
  980.     //define EV_BREAK            0x0040  // BREAK received
  981.     //define EV_ERR              0x0080  // Line status error occurred
  982.     //define EV_RING             0x0100  // Ring signal detected
  983.     //define EV_PERR             0x0200  // Printer error occured
  984.     //define EV_RX80FULL         0x0400  // Receive buffer is 80 percent full
  985.     //define EV_EVENT1           0x0800  // Provider specific event 1
  986.     //define EV_EVENT2           0x1000  // Provider specific event 2
  987.  
  988.     //
  989.     // Escape Functions
  990.     //
  991.  
  992.     //define SETXOFF             1       // Simulate XOFF received
  993.     //define SETXON              2       // Simulate XON received
  994.     //define SETRTS              3       // Set RTS high
  995.     //define CLRRTS              4       // Set RTS low
  996.     //define SETDTR              5       // Set DTR high
  997.     //define CLRDTR              6       // Set DTR low
  998.     //define RESETDEV            7       // Reset device if possible
  999.     //define SETBREAK            8       // Set the device break line.
  1000.     //define CLRBREAK            9       // Clear the device break line.
  1001.  
  1002.     //
  1003.     // PURGE function flags.
  1004.     //
  1005.     //define PURGE_TXABORT       0x0001  // Kill the pending/current writes to the comm port.
  1006.     //define PURGE_RXABORT       0x0002  // Kill the pending/current reads to the comm port.
  1007.     //define PURGE_TXCLEAR       0x0004  // Kill the transmit queue if there.
  1008.     //define PURGE_RXCLEAR       0x0008  // Kill the typeahead buffer if there.
  1009.  
  1010.     //define LPTx                0x80    // Set if ID is for LPT device
  1011.  
  1012.     //
  1013.     // Modem Status Flags
  1014.     //
  1015.     //define MS_CTS_ON           ((DWORD)0x0010)
  1016.     //define MS_DSR_ON           ((DWORD)0x0020)
  1017.     //define MS_RING_ON          ((DWORD)0x0040)
  1018.     //define MS_RLSD_ON          ((DWORD)0x0080)
  1019.  
  1020.     //
  1021.     // WaitSoundState() Constants
  1022.     //
  1023.  
  1024.     //define S_QUEUEEMPTY        0
  1025.     //define S_THRESHOLD         1
  1026.     //define S_ALLTHRESHOLD      2
  1027.  
  1028.     //
  1029.     // Accent Modes
  1030.     //
  1031.  
  1032.     //define S_NORMAL      0
  1033.     //define S_LEGATO      1
  1034.     //define S_STACCATO    2
  1035.  
  1036.     //
  1037.     // SetSoundNoise() Sources
  1038.     //
  1039.  
  1040.     //define S_PERIOD512   0     // Freq = N/512 high pitch, less coarse hiss
  1041.     //define S_PERIOD1024  1     // Freq = N/1024
  1042.     //define S_PERIOD2048  2     // Freq = N/2048 low pitch, more coarse hiss
  1043.     //define S_PERIODVOICE 3     // Source is frequency from voice channel (3)
  1044.     //define S_WHITE512    4     // Freq = N/512 high pitch, less coarse hiss
  1045.     //define S_WHITE1024   5     // Freq = N/1024
  1046.     //define S_WHITE2048   6     // Freq = N/2048 low pitch, more coarse hiss
  1047.     //define S_WHITEVOICE  7     // Source is frequency from voice channel (3)
  1048.  
  1049.     //define S_SERDVNA     (-1)  // Device not available
  1050.     //define S_SEROFM      (-2)  // Out of memory
  1051.     //define S_SERMACT     (-3)  // Music active
  1052.     //define S_SERQFUL     (-4)  // Queue full
  1053.     //define S_SERBDNT     (-5)  // Invalid note
  1054.     //define S_SERDLN      (-6)  // Invalid note length
  1055.     //define S_SERDCC      (-7)  // Invalid note count
  1056.     //define S_SERDTP      (-8)  // Invalid tempo
  1057.     //define S_SERDVL      (-9)  // Invalid volume
  1058.     //define S_SERDMD      (-10) // Invalid mode
  1059.     //define S_SERDSH      (-11) // Invalid shape
  1060.     //define S_SERDPT      (-12) // Invalid pitch
  1061.     //define S_SERDFQ      (-13) // Invalid frequency
  1062.     //define S_SERDDR      (-14) // Invalid duration
  1063.     //define S_SERDSR      (-15) // Invalid source
  1064.     //define S_SERDST      (-16) // Invalid state
  1065.  
  1066.     const DWORD NMPWAIT_WAIT_FOREVER           = 0xffffffff;
  1067.     const DWORD NMPWAIT_NOWAIT                 = 0x00000001;
  1068.     const DWORD NMPWAIT_USE_DEFAULT_WAIT       = 0x00000000;
  1069.  
  1070.     //define FS_CASE_IS_PRESERVED            FILE_CASE_PRESERVED_NAMES
  1071.     //define FS_CASE_SENSITIVE               FILE_CASE_SENSITIVE_SEARCH
  1072.     //define FS_UNICODE_STORED_ON_DISK       FILE_UNICODE_ON_DISK
  1073.     //define FS_PERSISTENT_ACLS              FILE_PERSISTENT_ACLS
  1074.     //define FS_VOL_IS_COMPRESSED            FILE_VOLUME_IS_COMPRESSED
  1075.     //define FS_FILE_COMPRESSION             FILE_FILE_COMPRESSION
  1076.  
  1077.     [ helpstring("File mapping: Copy on write access") ]
  1078.     const long FILE_MAP_COPY        = 0x00000001; // SECTION_QUERY
  1079.     [ helpstring("File mapping: Read-write access") ]
  1080.     const long FILE_MAP_WRITE       = 0x00000002; // SECTION_MAP_WRITE
  1081.     [ helpstring("File mapping: Read-only access") ]
  1082.     const long FILE_MAP_READ        = 0x00000004; // SECTION_MAP_READ
  1083.     [ helpstring("File mapping: Read-write access") ]
  1084.     const long FILE_MAP_ALL_ACCESS  = 0x000F001F; // SECTION_ALL_ACCESS
  1085.  
  1086.     // OpenFile() Flags
  1087.     const DWORD OF_READ              = 0x0000;
  1088.     const DWORD OF_WRITE             = 0x0001;
  1089.     const DWORD OF_READWRITE         = 0x0002;
  1090.     const DWORD OF_SHARE_COMPAT      = 0x0000;
  1091.     const DWORD OF_SHARE_EXCLUSIVE   = 0x0010;
  1092.     const DWORD OF_SHARE_DENY_WRITE  = 0x0020;
  1093.     const DWORD OF_SHARE_DENY_READ   = 0x0030;
  1094.     const DWORD OF_SHARE_DENY_NONE   = 0x0040;
  1095.     const DWORD OF_PARSE             = 0x0100;
  1096.     const DWORD OF_DELETE            = 0x0200;
  1097.     const DWORD OF_VERIFY            = 0x0400;
  1098.     const DWORD OF_SEARCH            = 0x0400;
  1099.     const DWORD OF_CANCEL            = 0x0800;
  1100.     const DWORD OF_CREATE            = 0x1000;
  1101.     const DWORD OF_PROMPT            = 0x2000;
  1102.     const DWORD OF_EXIST             = 0x4000;
  1103.     const DWORD OF_REOPEN            = 0x8000;
  1104.  
  1105.     const int OFS_MAXPATHNAME       = 128;
  1106.     //define PROCESS_HEAP_REGION             0x0001
  1107.     //define PROCESS_HEAP_UNCOMMITTED_RANGE  0x0002
  1108.     //define PROCESS_HEAP_ENTRY_BUSY         0x0004
  1109.     //define PROCESS_HEAP_ENTRY_MOVEABLE     0x0010
  1110.     //define PROCESS_HEAP_ENTRY_DDESHARE     0x0020
  1111.  
  1112.     [ helpstring("GetBinaryType: Win32 application") ]
  1113.     const UINT SCS_32BIT_BINARY  = 0;
  1114.     [ helpstring("GetBinaryType: MS-DOS application") ]
  1115.     const UINT SCS_DOS_BINARY    = 1;
  1116.     [ helpstring("GetBinaryType: 16-bit Windows application") ]
  1117.     const UINT SCS_WOW_BINARY    = 2;
  1118.     [ helpstring("GetBinaryType: PIF file") ]
  1119.     const UINT SCS_PIF_BINARY    = 3;
  1120.     [ helpstring("GetBinaryType: Posix application") ]
  1121.     const UINT SCS_POSIX_BINARY  = 4;
  1122.     [ helpstring("GetBinaryType: 16-bit OS/2 application") ]
  1123.     const UINT SCS_OS216_BINARY  = 5;
  1124.  
  1125.     const DWORD LOCKFILE_FAIL_IMMEDIATELY  = 0x00000001;
  1126.     const DWORD LOCKFILE_EXCLUSIVE_LOCK    = 0x00000002;
  1127.  
  1128.     const DWORD HANDLE_FLAG_INHERIT        = 0x00000001;
  1129.     const DWORD HANDLE_FLAG_AUDIT_ON_CLOSE = 0x00000002;
  1130.  
  1131.     const int HINSTANCE_ERROR = 32;
  1132.  
  1133.     /*
  1134.     //  Stream Ids
  1135.  
  1136.     const DWORD BACKUP_INVALID         = 0x00000000;
  1137.     const DWORD BACKUP_DATA            = 0x00000001;
  1138.     const DWORD BACKUP_EA_DATA         = 0x00000002;
  1139.     const DWORD BACKUP_SECURITY_DATA   = 0x00000003;
  1140.     const DWORD BACKUP_ALTERNATE_DATA  = 0x00000004;
  1141.     const DWORD BACKUP_LINK            = 0x00000005;
  1142.     const DWORD BACKUP_PROPERTY_DATA   = 0x00000006;
  1143.  
  1144.     //  Stream Attributes
  1145.  
  1146.     const DWORD STREAM_NORMAL_ATTRIBUTE    = 0x00000000;
  1147.     const DWORD STREAM_MODIFIED_WHEN_READ  = 0x00000001;
  1148.     const DWORD STREAM_CONTAINS_SECURITY   = 0x00000002;
  1149.     const DWORD STREAM_CONTAINS_PROPERTIES = 0x00000004;
  1150.     */
  1151.  
  1152.     const DWORD STARTF_USESHOWWINDOW        = 0x00000001;
  1153.     const DWORD STARTF_USESIZE              = 0x00000002;
  1154.     const DWORD STARTF_USEPOSITION          = 0x00000004;
  1155.     const DWORD STARTF_USECOUNTCHARS        = 0x00000008;
  1156.     const DWORD STARTF_USEFILLATTRIBUTE     = 0x00000010;
  1157.     const DWORD STARTF_RUNFULLSCREEN        = 0x00000020;  // ignored for non-x86 platforms
  1158.     const DWORD STARTF_FORCEONFEEDBACK      = 0x00000040;
  1159.     const DWORD STARTF_FORCEOFFFEEDBACK     = 0x00000080;
  1160.     const DWORD STARTF_USESTDHANDLES        = 0x00000100;
  1161.  
  1162.     const DWORD SHUTDOWN_NORETRY               = 0x00000001;
  1163.  
  1164.     const DWORD DONT_RESOLVE_DLL_REFERENCES = 0x00000001;
  1165.     const DWORD LOAD_LIBRARY_AS_DATAFILE    = 0x00000002;
  1166.     const DWORD LOAD_WITH_ALTERED_SEARCH_PATH   = 0x00000008;
  1167.  
  1168.     /*
  1169.     const DWORD DDD_RAW_TARGET_PATH        = 0x00000001;
  1170.     const DWORD DDD_REMOVE_DEFINITION      = 0x00000002;
  1171.     const DWORD DDD_EXACT_MATCH_ON_REMOVE  = 0x00000004;
  1172.     */
  1173.  
  1174.     const DWORD MOVEFILE_REPLACE_EXISTING       = 0x00000001;
  1175.     const DWORD MOVEFILE_COPY_ALLOWED           = 0x00000002;
  1176.     const DWORD MOVEFILE_DELAY_UNTIL_REBOOT     = 0x00000004;
  1177.  
  1178.     [ helpstring("GetComputerName: Maximum name length") ]
  1179.     const int MAX_COMPUTERNAME_LENGTH  = 15;
  1180.  
  1181.     //define LOGON32_LOGON_INTERACTIVE   2
  1182.     //define LOGON32_LOGON_BATCH         4
  1183.     //define LOGON32_LOGON_SERVICE       5
  1184.  
  1185.     //define LOGON32_PROVIDER_DEFAULT    0
  1186.     //define LOGON32_PROVIDER_WINNT35    1
  1187.  
  1188.     const int VER_PLATFORM_WIN32s        = 0;
  1189.     const int VER_PLATFORM_WIN32_WINDOWS = 1;
  1190.     const int VER_PLATFORM_WIN32_NT      = 2;
  1191.  
  1192.     // Abnormal termination codes
  1193.  
  1194.     const int TC_NORMAL       = 0;
  1195.     const int TC_HARDERR      = 1;
  1196.     const int TC_GP_TRAP      = 2;
  1197.     const int TC_SIGNAL       = 3;
  1198.  
  1199.     const DWORD AC_LINE_OFFLINE                 = 0x00;
  1200.     const DWORD AC_LINE_ONLINE                  = 0x01;
  1201.     const DWORD AC_LINE_BACKUP_POWER            = 0x02;
  1202.     const DWORD AC_LINE_UNKNOWN                 = 0xFF;
  1203.  
  1204.     const DWORD BATTERY_FLAG_HIGH               = 0x01;
  1205.     const DWORD BATTERY_FLAG_LOW                = 0x02;
  1206.     const DWORD BATTERY_FLAG_CRITICAL           = 0x04;
  1207.     const DWORD BATTERY_FLAG_CHARGING           = 0x08;
  1208.     const DWORD BATTERY_FLAG_NO_BATTERY         = 0x80;
  1209.     const DWORD BATTERY_FLAG_UNKNOWN            = 0xFF;
  1210.  
  1211.     const DWORD BATTERY_PERCENTAGE_UNKNOWN      = 0xFF;
  1212.  
  1213.     const DWORD BATTERY_LIFE_UNKNOWN        = 0xFFFFFFFF;
  1214.  
  1215.  
  1216.     // Definitions from WINNT
  1217.     /*
  1218.     const long SEC_IMAGE            = 0x01000000;
  1219.     const long SEC_RESERVE          = 0x04000000;
  1220.     const long SEC_COMMIT           = 0x08000000;
  1221.     const long SEC_NOCACHE          = 0x10000000;
  1222.     */
  1223.  
  1224.     //  Masks for predefined standard access types
  1225.  
  1226.     const DWORD DELETE                = 0x00010000;
  1227.     const DWORD READ_CONTROL        = 0x00020000;
  1228.     const DWORD WRITE_DAC           = 0x00040000;
  1229.     const DWORD WRITE_OWNER         = 0x00080000;
  1230.     const DWORD SYNCHRONIZE         = 0x00100000;
  1231.  
  1232.     const DWORD STANDARD_RIGHTS_REQUIRED    = 0x000F0000;
  1233.  
  1234.     const DWORD STANDARD_RIGHTS_READ    = 0x00020000; // READ_CONTROL
  1235.     const DWORD STANDARD_RIGHTS_WRITE   = 0x00020000; // READ_CONTROL         
  1236.     const DWORD STANDARD_RIGHTS_EXECUTE = 0x00020000; // READ_CONTROL         
  1237.  
  1238.     const DWORD STANDARD_RIGHTS_ALL     = 0x001F0000;
  1239.  
  1240.     const DWORD SPECIFIC_RIGHTS_ALL     = 0x0000FFFF;
  1241.  
  1242.     // AccessSystemAcl access type
  1243.  
  1244.     const DWORD ACCESS_SYSTEM_SECURITY  = 0x01000000;
  1245.  
  1246.     // MaximumAllowed access type
  1247.  
  1248.     const DWORD MAXIMUM_ALLOWED         = 0x02000000;
  1249.  
  1250.     // These are the generic rights
  1251.  
  1252.     const DWORD GENERIC_READ            = 0x80000000;
  1253.     const DWORD GENERIC_WRITE           = 0x40000000; 
  1254.     const DWORD GENERIC_EXECUTE         = 0x20000000; 
  1255.     const DWORD GENERIC_ALL             = 0x10000000;
  1256.  
  1257.     const long FILE_SHARE_READ          = 0x00000001;
  1258.     const long FILE_SHARE_WRITE         = 0x00000002;
  1259.     const long FILE_ATTRIBUTE_READONLY  = 0x00000001;
  1260.     const long FILE_ATTRIBUTE_HIDDEN    = 0x00000002;
  1261.     const long FILE_ATTRIBUTE_SYSTEM    = 0x00000004;
  1262.     const long FILE_ATTRIBUTE_DIRECTORY = 0x00000010;
  1263.     const long FILE_ATTRIBUTE_ARCHIVE   = 0x00000020;
  1264.     const long FILE_ATTRIBUTE_NORMAL    = 0x00000080;
  1265.     const long FILE_ATTRIBUTE_TEMPORARY = 0x00000100;
  1266.     const long FILE_ATTRIBUTE_COMPRESSED = 0x00000800;
  1267.  
  1268.  
  1269. }
  1270.  
  1271. // Functions
  1272. [
  1273. #ifdef UNICODE
  1274. uuid(64675048-3A82-101B-8181-00AA003743D3),
  1275. #else
  1276. uuid(64674048-3A82-101B-8181-00AA003743D3),
  1277. #endif
  1278. helpstring("Win32 Base Functions"),
  1279. dllname("KERNEL32.DLL")
  1280. ]
  1281. module WinBase {
  1282.  
  1283.     [
  1284.     usesgetlasterror,
  1285.     entry("RtlMoveMemory"),
  1286.     helpstring("Copies memory from source to destination by reference"),
  1287.     ]
  1288.     void WINAPI CopyMemory(LPVOID pvDst,
  1289.                            LPVOID pvSrc, DWORD cbCopy);
  1290.  
  1291.     [
  1292.     usesgetlasterror,
  1293.     entry("RtlMoveMemory"),
  1294.     helpstring("Copies memory from source string to destination by reference"),
  1295.     ]
  1296.     void WINAPI CopyMemoryStr(LPVOID pvDst,
  1297.                               LPTSTR pvSrc, DWORD cbCopy);
  1298.  
  1299.     [
  1300.     usesgetlasterror,
  1301.     entry("RtlMoveMemory"),
  1302.     helpstring("Copies memory from source string to destination string by reference"),
  1303.     ]
  1304.     void WINAPI CopyMemoryStrToStr(LPTSTR pvDst,
  1305.                                    LPTSTR pvSrc, DWORD cbCopy);
  1306.  
  1307.     [
  1308.     usesgetlasterror,
  1309.     entry("RtlMoveMemory"),
  1310.     helpstring("Copies memory from source to destination string by reference"),
  1311.     ]
  1312.     void WINAPI CopyMemoryToStr(LPTSTR pvDst,
  1313.                                 LPVOID pvSrc, DWORD cbCopy);
  1314.  
  1315.     [
  1316.     usesgetlasterror,
  1317.     entry("RtlMoveMemory"),
  1318.     helpstring("Copies memory from source to destination by value"),
  1319.     ]
  1320.     void WINAPI CopyMemoryVal(void pvDest,
  1321.                               void pvSrc, DWORD cbCopy);
  1322.  
  1323.     [
  1324.     usesgetlasterror,
  1325.     entry("RtlMoveMemory"),
  1326.     helpstring("Copies memory from pointer to byte array"),
  1327.     ]
  1328.     void WINAPI CopyMemoryLpToByte(BYTE * pvDest,
  1329.                                    DWORD pvSrc, DWORD cbCopy);
  1330.  
  1331.     [
  1332.     usesgetlasterror,
  1333.     entry("RtlMoveMemory"),
  1334.     helpstring("Copies memory from pointer to byte array"),
  1335.     ]
  1336.     void WINAPI CopyMemoryLpForByte(DWORD pvDest,
  1337.                                     BYTE * pvSrc,
  1338.                                     DWORD cbCopy);
  1339.  
  1340.     [
  1341.     usesgetlasterror,
  1342.     entry("RtlMoveMemory"),
  1343.     helpstring("Copies memory from pointer to string"),
  1344.     ]
  1345.     void WINAPI CopyMemoryLpToStr(LPTSTR lpszDest,
  1346.                                   DWORD pvSrc, DWORD cbCopy);
  1347.  
  1348.     [
  1349.     usesgetlasterror,
  1350.     entry("RtlMoveMemory"),
  1351.     helpstring("Copies memory from pointer to pointer"),
  1352.     ]
  1353.     void WINAPI CopyMemoryLpToLp(DWORD pvDest,
  1354.                                  DWORD pvSrc, DWORD cbCopy);
  1355.  
  1356.     [
  1357.     usesgetlasterror,
  1358.     entry("RtlFillMemory"),
  1359.     helpstring("Fills memory to destination by reference"),
  1360.     ]
  1361.     void WINAPI FillMemory(LPVOID pvDst, DWORD cbCopy, BYTE bFill);
  1362.  
  1363.     [
  1364.     usesgetlasterror,
  1365.     entry("RtlFillMemory"),
  1366.     helpstring("Fills memory to destination string"),
  1367.     ]
  1368.     void WINAPI FillMemoryToStr(LPTSTR pvDst, DWORD cbCopy, BYTE bFill);
  1369.  
  1370.     [
  1371.     usesgetlasterror,
  1372.     entry("RtlFillMemory"),
  1373.     helpstring("Fills memory to byte array"),
  1374.     ]
  1375.     void WINAPI FillMemoryToByte(BYTE * pvDest, DWORD cbCopy, BYTE bFill);
  1376.  
  1377.     [
  1378.     usesgetlasterror,
  1379.     entry("RtlFillMemory"),
  1380.     helpstring("Fills memory to pointer"),
  1381.     ]
  1382.     void WINAPI FillMemoryLp(DWORD pvDest, DWORD cbCopy, BYTE bFill);
  1383.  
  1384.     [
  1385.     usesgetlasterror,
  1386.     entry("RtlZeroMemory"),
  1387.     helpstring("Zeros memory to destination by reference"),
  1388.     ]
  1389.     void WINAPI ZeroMemory(LPVOID pvDst, DWORD cbCopy);
  1390.  
  1391.     [
  1392.     usesgetlasterror,
  1393.     entry("RtlZeroMemory"),
  1394.     helpstring("Zeros memory to destination string"),
  1395.     ]
  1396.     void WINAPI ZeroMemoryToStr(LPTSTR pvDst, DWORD cbCopy);
  1397.  
  1398.     [
  1399.     usesgetlasterror,
  1400.     entry("RtlZeroMemory"),
  1401.     helpstring("Zeros memory to byte array"),
  1402.     ]
  1403.     void WINAPI ZeroMemoryToByte(BYTE * pvDest, DWORD cbCopy);
  1404.  
  1405.     [
  1406.     usesgetlasterror,
  1407.     entry("RtlZeroMemory"),
  1408.     helpstring("Zeros memory to pointer"),
  1409.     ]
  1410.     void WINAPI ZeroMemoryLp(DWORD pvDest, DWORD cbCopy);
  1411.  
  1412.     /* Interlocked not implemented
  1413.     LONG WINAPI InterlockedIncrement(LONG * lpAddend);
  1414.  
  1415.     LONG WINAPI InterlockedDecrement(LONG * lpAddend);
  1416.  
  1417.     LONG WINAPI InterlockedExchange(LONG * Target, LONG Value);
  1418.     */
  1419.  
  1420.     [
  1421.     usesgetlasterror,
  1422.     entry("FreeResource"),
  1423.     helpstring("Frees a loaded resource passed by the handle received from LoadResource"),
  1424.     ]
  1425.     BOOL    WINAPI FreeResource(HGLOBAL hglbResource);
  1426.  
  1427.     [
  1428.     usesgetlasterror,
  1429.     entry("LockResource"),
  1430.     helpstring("Locks resource memory block and returns global pointer to it"),
  1431.     ]
  1432.     LONG WINAPI LockResource(HGLOBAL hglbResource);
  1433.     // void FAR* WINAPI LockResource(HGLOBAL hglbResource);
  1434.  
  1435.     /* Note: In Win32 UnlockResource is a macro returning zero.
  1436.        Documentation says that you need not unlock resources.
  1437.        Therefore, the type library does not attempt to alias or
  1438.        implement UnlockResource.
  1439.     */
  1440.     //define UnlockResource(hResData) ((hResData), 0)
  1441.     //define MAXINTATOM 0xC000
  1442.     //define MAKEINTATOM(i)  (LPTSTR)((DWORD)((WORD)(i)))
  1443.     //define INVALID_ATOM ((ATOM)0)
  1444.  
  1445.  
  1446.     [
  1447.     usesgetlasterror,
  1448.     entry("FreeLibrary"),
  1449.     helpstring("Free a DLL"),
  1450.     ]
  1451.     void        WINAPI FreeLibrary(HINSTANCE hInst);
  1452.  
  1453.     /*
  1454.     VOID WINAPI FreeLibraryAndExitThread(
  1455.         HMODULE hLibModule,
  1456.         DWORD dwExitCode
  1457.         );
  1458.  
  1459.     BOOL WINAPI DisableThreadLibraryCalls(
  1460.         HMODULE hLibModule
  1461.         );
  1462.  
  1463.     FARPROC WINAPI GetProcAddress(
  1464.         HMODULE hModule,
  1465.         LPCTSTR lpProcName
  1466.         );
  1467.     */
  1468.  
  1469.     [
  1470.     usesgetlasterror,
  1471.     entry("GetVersion"),
  1472.     helpstring("Gets Windows version number"),
  1473.     ]
  1474.     DWORD WINAPI GetVersion();
  1475.  
  1476.     // ****** Global memory management ******
  1477.  
  1478.     [
  1479.     usesgetlasterror,
  1480.     entry("GlobalAlloc"),
  1481.     helpstring("Allocate global memory"),
  1482.     ]
  1483.     HGLOBAL WINAPI GlobalAlloc(UINT fuAlloc, DWORD cbAlloc);
  1484.  
  1485.     [
  1486.     usesgetlasterror,
  1487.     entry("GlobalReAlloc"),
  1488.     helpstring("Resize global memory block"),
  1489.     ]
  1490.     HGLOBAL WINAPI GlobalReAlloc(
  1491.             HGLOBAL hglb, DWORD cbNewSize, UINT fuAlloc);
  1492.  
  1493.     [
  1494.     usesgetlasterror,
  1495.     entry("GlobalSize"),
  1496.     helpstring("Gets the size of global memory block"),
  1497.     ]
  1498.     DWORD   WINAPI GlobalSize(HGLOBAL hglb);
  1499.  
  1500.     [
  1501.     usesgetlasterror,
  1502.     entry("GlobalFlags"),
  1503.     helpstring("Gets attribute flags of global memory block"),
  1504.     ]
  1505.     UINT    WINAPI GlobalFlags(HGLOBAL hglb);
  1506.  
  1507.     [
  1508.     usesgetlasterror,
  1509.     entry("GlobalLock"),
  1510.     helpstring("Locks global memory block and returns pointer to it"),
  1511.     ]
  1512.     LONG WINAPI GlobalLock(HGLOBAL hglb);
  1513.  
  1514.     [
  1515.     usesgetlasterror,
  1516.     entry("GlobalHandle"),
  1517.     helpstring(""),
  1518.     ]
  1519.     HGLOBAL WINAPI GlobalHandle(LPCVOID pMem);
  1520.  
  1521.     [
  1522.     usesgetlasterror,
  1523.     entry("GlobalUnlock"),
  1524.     helpstring("Unlocks global memory block"),
  1525.     ]
  1526.     BOOL    WINAPI GlobalUnlock(HGLOBAL hglb);
  1527.  
  1528.     [
  1529.     usesgetlasterror,
  1530.     entry("GlobalFree"),
  1531.     helpstring("Free global memory block"),
  1532.     ]
  1533.     HGLOBAL WINAPI GlobalFree(HGLOBAL hglb);
  1534.  
  1535.     /*
  1536.     UINT WINAPI GlobalCompact(DWORD dwMinFree);
  1537.  
  1538.     VOID WINAPI GlobalFix(HGLOBAL hMem);
  1539.  
  1540.     VOID WINAPI GlobalUnfix(HGLOBAL hMem);
  1541.  
  1542.     LONG WINAPI GlobalWire(HGLOBAL hMem);
  1543.  
  1544.     BOOL WINAPI GlobalUnWire(HGLOBAL hMem);
  1545.     */
  1546.  
  1547.     [
  1548.     usesgetlasterror,
  1549.     entry("GlobalMemoryStatus"),
  1550.     helpstring(""),
  1551.     ]
  1552.     void WINAPI GlobalMemoryStatus(MEMORYSTATUS * lpBuffer);
  1553.  
  1554.     /* All of local memory omitted
  1555.     HLOCAL
  1556.     WINAPI
  1557.     LocalAlloc(
  1558.         UINT uFlags,
  1559.         UINT uBytes
  1560.         );
  1561.  
  1562.     HLOCAL
  1563.     WINAPI
  1564.     LocalReAlloc(
  1565.         HLOCAL hMem,
  1566.         UINT uBytes,
  1567.         UINT uFlags
  1568.         );
  1569.  
  1570.     LONG     
  1571.     WINAPI
  1572.     LocalLock(
  1573.         HLOCAL hMem
  1574.         );
  1575.  
  1576.     HLOCAL
  1577.     WINAPI
  1578.     LocalHandle(
  1579.         LPCVOID pMem
  1580.         );
  1581.  
  1582.     BOOL
  1583.     WINAPI
  1584.     LocalUnlock(
  1585.         HLOCAL hMem
  1586.         );
  1587.  
  1588.     UINT
  1589.     WINAPI
  1590.     LocalSize(
  1591.         HLOCAL hMem
  1592.         );
  1593.  
  1594.     UINT
  1595.     WINAPI
  1596.     LocalFlags(
  1597.         HLOCAL hMem
  1598.         );
  1599.  
  1600.     HLOCAL
  1601.     WINAPI
  1602.     LocalFree(
  1603.         HLOCAL hMem
  1604.         );
  1605.  
  1606.     UINT
  1607.     WINAPI
  1608.     LocalShrink(
  1609.         HLOCAL hMem,
  1610.         UINT cbNewSize
  1611.         );
  1612.  
  1613.     UINT
  1614.     WINAPI
  1615.     LocalCompact(
  1616.         UINT uMinFree
  1617.         );
  1618.  
  1619.     */
  1620.  
  1621.     /* Instruction cache not implemented
  1622.     BOOL WINAPI FlushInstructionCache(
  1623.         HANDLE hProcess,
  1624.         LPCvoid lpBaseAddress,
  1625.         DWORD  dwSize
  1626.         );
  1627.     */
  1628.  
  1629.     [
  1630.     usesgetlasterror,
  1631.     entry("VirtualAlloc"),
  1632.     helpstring(""),
  1633.     ]
  1634.     LONG WINAPI VirtualAlloc(DWORD lpAddress,
  1635.                              DWORD dwSize,
  1636.                              DWORD flAllocationType, 
  1637.                              DWORD flProtect);
  1638.  
  1639.     [
  1640.     usesgetlasterror,
  1641.     entry("VirtualFree"),
  1642.     helpstring(""),
  1643.     ]
  1644.     BOOL WINAPI VirtualFree(DWORD lpAddress,
  1645.                             DWORD dwSize,
  1646.                             DWORD dwFreeType);
  1647.  
  1648.     [
  1649.     usesgetlasterror,
  1650.     entry("VirtualProtect"),
  1651.     helpstring(""),
  1652.     ]
  1653.     BOOL WINAPI VirtualProtect(DWORD lpAddress,
  1654.                                DWORD dwSize,
  1655.                                DWORD flNewProtect, 
  1656.                                DWORD * lpflOldProtect);
  1657.  
  1658.     /*
  1659.     [
  1660.     usesgetlasterror,
  1661.     entry("VirtualQuery"),
  1662.     helpstring(""),
  1663.     ]
  1664.     DWORD WINAPI VirtualQuery(DWORD lpAddress,
  1665.                               PMEMORY_BASIC_INFORMATION lpBuffer,
  1666.                               DWORD dwLength);
  1667.     */
  1668.  
  1669.     [
  1670.     usesgetlasterror,
  1671.     entry("VirtualProtectEx"),
  1672.     helpstring(""),
  1673.     ]
  1674.     BOOL WINAPI VirtualProtectEx(HANDLE hProcess, 
  1675.                                  DWORD lpAddress,
  1676.                                  DWORD dwSize, 
  1677.                                  DWORD flNewProtect,
  1678.                                  DWORD * lpflOldProtect);
  1679.  
  1680.     /*
  1681.     [
  1682.     usesgetlasterror,
  1683.     entry("VirtualQueryEx"),
  1684.     helpstring(""),
  1685.     ]
  1686.     DWORD WINAPI VirtualQueryEx(HANDLE hProcess, 
  1687.                                 DWORD lpAddress,
  1688.                                 PMEMORY_BASIC_INFORMATION lpBuffer,
  1689.                                 DWORD dwLength);
  1690.     */
  1691.  
  1692.  
  1693.     /* Heap memory not implemented
  1694.     HANDLE WINAPI HeapCreate(DWORD flOptions, DWORD dwInitialSize,
  1695.                              DWORD dwMaximumSize);
  1696.     BOOL WINAPI HeapDestroy(HANDLE hHeap);
  1697.     LONG WINAPI HeapAlloc(HANDLE hHeap, DWORD dwFlags, DWORD dwBytes);
  1698.     LONG WINAPI HeapReAlloc(HANDLE hHeap, DWORD dwFlags,
  1699.                             LPVOID lpMem, DWORD dwBytes);
  1700.     BOOL WINAPI HeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);
  1701.     DWORD WINAPI HeapSize(HANDLE hHeap, DWORD dwFlags, LPCvoid lpMem);
  1702.     BOOL WINAPI HeapValidate(HANDLE hHeap, DWORD dwFlags, LPCvoid lpMem);
  1703.     HANDLE WINAPI GetProcessHeap( void );
  1704.     BOOL WINAPI HeapLock(HANDLE hHeap);
  1705.     BOOL WINAPI HeapUnlock(HANDLE hHeap);
  1706.     BOOL WINAPI HeapWalk(HANDLE hHeap, PROCESS_HEAP_ENTRY * lpEntry);
  1707.     */
  1708.  
  1709.     [
  1710.     usesgetlasterror,
  1711.     #ifdef UNICODE
  1712.     entry("GetBinaryTypeW"),
  1713.     #else
  1714.     entry("GetBinaryTypeA"),
  1715.     #endif
  1716.     helpstring("Determine whether an application is executable, and if so, on what platform"),
  1717.     ]
  1718.     BOOL WINAPI GetBinaryType(LPCTSTR lpApplicationName,
  1719.                               DWORD * lpBinaryType);
  1720.  
  1721.     [
  1722.     usesgetlasterror,
  1723.     #ifdef UNICODE
  1724.     entry("GetShortPathNameW"),
  1725.     #else
  1726.     entry("GetShortPathNameA"),
  1727.     #endif
  1728.     helpstring(""),
  1729.     ]
  1730.     DWORD WINAPI GetShortPathName(LPCTSTR lpszLongPath,
  1731.                                   LPTSTR lpszShortPath,
  1732.                                   DWORD cchBuffer);
  1733.  
  1734.     /* Most of process functions not implemented
  1735.     BOOL WINAPI GetProcessAffinityMask(HANDLE hProcess,
  1736.                                        LPDWORD lpProcessAffinityMask,
  1737.                                        LPDWORD lpSystemAffinityMask);
  1738.     BOOL WINAPI GetProcessTimes(HANDLE hProcess,
  1739.                                 LPFILETIME lpCreationTime,
  1740.                                 LPFILETIME lpExitTime,
  1741.                                 LPFILETIME lpKernelTime,
  1742.                                 LPFILETIME lpUserTime);
  1743.     BOOL WINAPI GetProcessWorkingSetSize(HANDLE hProcess,
  1744.                                          LPDWORD lpMinimumWorkingSetSize,
  1745.                                          LPDWORD lpMaximumWorkingSetSize);
  1746.     BOOL WINAPI SetProcessWorkingSetSize(HANDLE hProcess,
  1747.                                          DWORD  dwMinimumWorkingSetSize,
  1748.                                          DWORD  dwMaximumWorkingSetSize);
  1749.     */
  1750.  
  1751.  
  1752.     [
  1753.     usesgetlasterror,
  1754.     entry("OpenProcess"),
  1755.     helpstring("Given a process ID number, returns handle of existing process"),
  1756.     ]
  1757.     HANDLE WINAPI OpenProcess(EPROCESSACCESS dwDesiredAccess,
  1758.                               BOOL bInheritHandle,
  1759.                               DWORD dwProcessId);
  1760.  
  1761.     [
  1762.     usesgetlasterror,
  1763.     entry("GetCurrentProcess"),
  1764.     helpstring("Gets the process handle of the current process"),
  1765.     ]
  1766.     HANDLE WINAPI GetCurrentProcess(void);
  1767.  
  1768.     [
  1769.     usesgetlasterror,
  1770.     entry("GetCurrentProcessId"),
  1771.     helpstring("Gets the process ID number of the current process"),
  1772.     ]
  1773.     DWORD WINAPI GetCurrentProcessId(void);
  1774.  
  1775.     [
  1776.     usesgetlasterror,
  1777.     entry("ExitProcess"),
  1778.     helpstring("Ends a process and all its threads"),
  1779.     ]
  1780.     void WINAPI ExitProcess(UINT uExitCode);
  1781.  
  1782.     [
  1783.     usesgetlasterror,
  1784.     entry("TerminateProcess"),
  1785.     helpstring("Terminates the specified process and all its threads"),
  1786.     ]
  1787.     BOOL WINAPI TerminateProcess(HANDLE hProcess, 
  1788.                                  UINT uExitCode);
  1789.  
  1790.     [
  1791.     usesgetlasterror,
  1792.     entry("GetExitCodeProcess"),
  1793.     helpstring("Gets the termination status of a given process"),
  1794.     ]
  1795.     BOOL WINAPI GetExitCodeProcess(HANDLE hProcess,
  1796.                                    DWORD * lpExitCode);
  1797.  
  1798.     [
  1799.     usesgetlasterror,
  1800.     entry("FatalExit"),
  1801.     helpstring("Transfers execution control to the debugger"),
  1802.     ]
  1803.     void WINAPI FatalExit(int ExitCode);
  1804.     
  1805.     [
  1806.     usesgetlasterror,
  1807.     entry("GetEnvironmentStrings"),
  1808.     helpstring("Returns pointer to environment variable strings (with terminating double null)"),
  1809.     ]
  1810.     DWORD WINAPI GetEnvironmentStrings(void);
  1811.  
  1812.     /*
  1813.     LPTSTR WINAPI GetEnvironmentStrings(void);
  1814.     LPWSTR WINAPI GetEnvironmentStringsW(void);
  1815.     BOOL WINAPI FreeEnvironmentStringsA(LPTSTR);
  1816.     */
  1817.  
  1818.     /* Exceptions not implemented
  1819.     void WINAPI RaiseException(
  1820.         DWORD dwExceptionCode,
  1821.         DWORD dwExceptionFlags,
  1822.         DWORD nNumberOfArguments,
  1823.         CONST DWORD *lpArguments
  1824.         );
  1825.  
  1826.     LONG WINAPI UnhandledExceptionFilter(
  1827.         struct _EXCEPTION_POINTERS *ExceptionInfo
  1828.         );
  1829.  
  1830.     LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter(
  1831.         LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter
  1832.         );
  1833.     */
  1834.  
  1835.     /* Threads not implemented
  1836.     HANDLE WINAPI CreateThread(
  1837.         DWORD SECURITY_ATTRIBUTES * lpThreadAttributes,
  1838.         DWORD  dwStackSize,
  1839.         LPTHREAD_START_ROUTINE lpStartAddress,
  1840.         LPVOID lpParameter,
  1841.         DWORD  dwCreationFlags,
  1842.         DWORD * lpThreadId
  1843.         );
  1844.  
  1845.     HANDLE WINAPI CreateRemoteThread(
  1846.         HANDLE hProcess,
  1847.         DWORD SECURITY_ATTRIBUTES * lpThreadAttributes,
  1848.         DWORD  dwStackSize,
  1849.         LPTHREAD_START_ROUTINE lpStartAddress,
  1850.         LPVOID lpParameter,
  1851.         DWORD  dwCreationFlags,
  1852.         DWORD * lpThreadId
  1853.         );
  1854.  
  1855.     HANDLE WINAPI GetCurrentThread(
  1856.         void
  1857.         );
  1858.  
  1859.     DWORD WINAPI GetCurrentThreadId(
  1860.         void
  1861.         );
  1862.  
  1863.     DWORD WINAPI SetThreadAffinityMask(
  1864.         HANDLE hThread,
  1865.         DWORD  dwThreadAffinityMask
  1866.         );
  1867.  
  1868.     BOOL WINAPI SetThreadPriority(
  1869.         HANDLE hThread,
  1870.         int nPriority
  1871.         );
  1872.  
  1873.     int WINAPI GetThreadPriority(
  1874.         HANDLE hThread
  1875.         );
  1876.  
  1877.     BOOL WINAPI GetThreadTimes(
  1878.         HANDLE hThread,
  1879.         LPFILETIME lpCreationTime,
  1880.         LPFILETIME lpExitTime,
  1881.         LPFILETIME lpKernelTime,
  1882.         LPFILETIME lpUserTime
  1883.         );
  1884.  
  1885.     void WINAPI ExitThread(
  1886.         DWORD  dwExitCode
  1887.         );
  1888.  
  1889.     BOOL WINAPI TerminateThread(
  1890.         HANDLE hThread,
  1891.         DWORD  dwExitCode
  1892.         );
  1893.  
  1894.     BOOL WINAPI GetExitCodeThread(
  1895.         HANDLE hThread,
  1896.         DWORD * lpExitCode
  1897.         );
  1898.  
  1899.     BOOL WINAPI GetThreadSelectorEntry(
  1900.         HANDLE hThread,
  1901.         DWORD  dwSelector,
  1902.         LPLDT_ENTRY lpSelectorEntry
  1903.         );
  1904.     */
  1905.  
  1906.     [
  1907.     usesgetlasterror,
  1908.     entry("GetLastError"),
  1909.     helpstring("Returns the number of the last error to occur"),
  1910.     ]
  1911.     DWORD WINAPI GetLastError(void);
  1912.  
  1913.     [
  1914.     usesgetlasterror,
  1915.     entry("SetLastError"),
  1916.     helpstring("Sets the last error number to dwErrCode"),
  1917.     ]
  1918.     void WINAPI SetLastError(DWORD dwErrCode);
  1919.  
  1920.     /* Completion not implemented
  1921.     BOOL WINAPI GetOverlappedResult(
  1922.         HANDLE hFile,
  1923.         OVERLAPPED * lpOverlapped,
  1924.         DWORD * lpNumberOfBytesTransferred,
  1925.         BOOL bWait
  1926.         );
  1927.  
  1928.     HANDLE WINAPI CreateIoCompletionPort(
  1929.         HANDLE FileHandle,
  1930.         HANDLE ExistingCompletionPort,
  1931.         DWORD  CompletionKey,
  1932.         DWORD  NumberOfConcurrentThreads
  1933.         );
  1934.  
  1935.     BOOL WINAPI GetQueuedCompletionStatus(
  1936.         HANDLE CompletionPort,
  1937.         DWORD * lpNumberOfBytesTransferred,
  1938.         DWORD * lpCompletionKey,
  1939.         OVERLAPPED * *lpOverlapped,
  1940.         DWORD  dwMilliseconds
  1941.         );
  1942.     */
  1943.  
  1944.     // SetErrorMode() constants
  1945.     const UINT SEM_FAILCRITICALERRORS     = 0x0001;
  1946.     const UINT SEM_NOGPFAULTERRORBOX      = 0x0002;
  1947.     const UINT SEM_NOALIGNMENTFAULTEXCEPT = 0x0004;
  1948.     const UINT SEM_NOOPENFILEERRORBOX     = 0x8000;
  1949.  
  1950.     [
  1951.     usesgetlasterror,
  1952.     entry("SetErrorMode"),
  1953.     helpstring("Sets the last the error mode"),
  1954.     ]
  1955.     UINT WINAPI SetErrorMode(UINT uMode);
  1956.  
  1957.     /* Debugger support not implemented
  1958.     BOOL WINAPI ReadProcessMemory(
  1959.         HANDLE hProcess,
  1960.         LPCvoid lpBaseAddress,
  1961.         LPVOID lpBuffer,
  1962.         DWORD  nSize,
  1963.         DWORD * lpNumberOfBytesRead
  1964.         );
  1965.  
  1966.     BOOL WINAPI WriteProcessMemory(
  1967.         HANDLE hProcess,
  1968.         LPVOID lpBaseAddress,
  1969.         LPVOID lpBuffer,
  1970.         DWORD  nSize,
  1971.         DWORD * lpNumberOfBytesWritten
  1972.         );
  1973.  
  1974.     BOOL WINAPI GetThreadContext(
  1975.         HANDLE hThread,
  1976.         LPCONTEXT lpContext
  1977.         );
  1978.  
  1979.     BOOL WINAPI SetThreadContext(
  1980.         HANDLE hThread,
  1981.         CONST CONTEXT *lpContext
  1982.         );
  1983.  
  1984.     DWORD WINAPI SuspendThread(
  1985.         HANDLE hThread
  1986.         );
  1987.  
  1988.     DWORD WINAPI ResumeThread(
  1989.         HANDLE hThread
  1990.         );
  1991.     */
  1992.  
  1993.     [
  1994.     usesgetlasterror,
  1995.     entry("DebugBreak"),
  1996.     helpstring("Break into a debugger"),
  1997.     ]
  1998.     void    WINAPI DebugBreak();
  1999.  
  2000.     /*
  2001.     BOOL WINAPI WaitForDebugEvent(
  2002.         LPDEBUG_EVENT lpDebugEvent,
  2003.         DWORD  dwMilliseconds
  2004.         );
  2005.  
  2006.     BOOL WINAPI ContinueDebugEvent(
  2007.         DWORD  dwProcessId,
  2008.         DWORD  dwThreadId,
  2009.         DWORD  dwContinueStatus
  2010.         );
  2011.  
  2012.     BOOL WINAPI DebugActiveProcess(
  2013.         DWORD  dwProcessId
  2014.         );
  2015.     */
  2016.  
  2017.     /* Critical sections not implemented
  2018.     void WINAPI InitializeCriticalSection(
  2019.         LPCRITICAL_SECTION lpCriticalSection
  2020.         );
  2021.  
  2022.     void WINAPI EnterCriticalSection(
  2023.         LPCRITICAL_SECTION lpCriticalSection
  2024.         );
  2025.  
  2026.     void WINAPI LeaveCriticalSection(
  2027.         LPCRITICAL_SECTION lpCriticalSection
  2028.         );
  2029.  
  2030.     void WINAPI DeleteCriticalSection(
  2031.         LPCRITICAL_SECTION lpCriticalSection
  2032.         );
  2033.     */
  2034.  
  2035.     /* Events not implemented
  2036.     BOOL WINAPI SetEvent(
  2037.         HANDLE hEvent
  2038.         );
  2039.  
  2040.     BOOL WINAPI ResetEvent(
  2041.         HANDLE hEvent
  2042.         );
  2043.  
  2044.     BOOL WINAPI PulseEvent(
  2045.         HANDLE hEvent
  2046.         );
  2047.     */
  2048.  
  2049.     /* Semaphores and mutexes not implemented
  2050.     BOOL WINAPI ReleaseSemaphore(
  2051.         HANDLE hSemaphore,
  2052.         LONG lReleaseCount,
  2053.         LPLONG lpPreviousCount
  2054.         );
  2055.  
  2056.     BOOL WINAPI ReleaseMutex(
  2057.         HANDLE hMutex
  2058.         );
  2059.     */
  2060.  
  2061.     [
  2062.     usesgetlasterror,
  2063.     entry("WaitForSingleObject"),
  2064.     helpstring("Waits until the specified object reaches the signaled state, or until the time-out elapses"),
  2065.     ]
  2066.     DWORD WINAPI WaitForSingleObject(
  2067.         HANDLE hHandle,
  2068.         DWORD dwMilliseconds
  2069.         );
  2070.  
  2071.     [
  2072.     usesgetlasterror,
  2073.     entry("WaitForMultipleObjects"),
  2074.     helpstring("Waits until any one or all of the specified objects reaches the signaled state, or until the time-out elapses"),
  2075.     ]
  2076.     DWORD WINAPI WaitForMultipleObjects(
  2077.         DWORD nCount,
  2078.         HANDLE *lpHandles,
  2079.         BOOL bWaitAll,
  2080.         DWORD dwMilliseconds
  2081.         );
  2082.  
  2083.     [
  2084.     usesgetlasterror,
  2085.     entry("Sleep"),
  2086.     helpstring("Suspends execution of the current thread for a specified interval"),
  2087.     ]
  2088.     void WINAPI Sleep(DWORD dwMilliseconds);
  2089.  
  2090.     [
  2091.     usesgetlasterror,
  2092.     entry("LoadResource"),
  2093.     helpstring("Loads a resource handle, returning a global memory handle with the resource"),
  2094.     ]
  2095.     HGLOBAL WINAPI LoadResource(HINSTANCE hInst, HRSRC hrsrc);
  2096.  
  2097.  
  2098.     [
  2099.     usesgetlasterror,
  2100.     entry("SizeofResource"),
  2101.     helpstring("Gets the size in bytes of a resource"),
  2102.     ]
  2103.     DWORD   WINAPI SizeofResource(HINSTANCE hInst, 
  2104.                                   HRSRC hrsrc);
  2105.  
  2106.     /* Omitted
  2107.     ATOM WINAPI GlobalDeleteAtom(ATOM nAtom);
  2108.     BOOL WINAPI InitAtomTable(DWORD nSize);
  2109.     ATOM WINAPI DeleteAtom(ATOM nAtom);
  2110.     */
  2111.  
  2112.     [
  2113.     usesgetlasterror,
  2114.     entry("SetHandleCount"),
  2115.     helpstring("Changes the number of file handles available to a process (has no effect under Windows NT)"),
  2116.     ]
  2117.     UINT WINAPI SetHandleCount(UINT uNumber);
  2118.  
  2119.     [
  2120.     usesgetlasterror,
  2121.     entry("GetLogicalDrives"),
  2122.     helpstring("Returns valid lettered drives in bit field (A in bit 0)"),
  2123.     ]
  2124.     DWORD WINAPI GetLogicalDrives(void);
  2125.  
  2126.     /* Not implemented
  2127.     BOOL WINAPI LockFile(HANDLE hFile, DWORD dwFileOffsetLow,
  2128.                          DWORD dwFileOffsetHigh,
  2129.                          DWORD nNumberOfBytesToLockLow,
  2130.                          DWORD nNumberOfBytesToLockHigh);
  2131.  
  2132.     BOOL WINAPI UnlockFile(HANDLE hFile,
  2133.                            DWORD dwFileOffsetLow,
  2134.                            DWORD dwFileOffsetHigh,
  2135.                            DWORD nNumberOfBytesToUnlockLow,
  2136.                            DWORD nNumberOfBytesToUnlockHigh);
  2137.  
  2138.     BOOL WINAPI LockFileEx(HANDLE hFile, DWORD dwFlags, DWORD dwReserved,
  2139.                            DWORD nNumberOfBytesToLockLow,
  2140.                            DWORD nNumberOfBytesToLockHigh,
  2141.                            LPOVERLAPPED lpOverlapped);
  2142.  
  2143.     BOOL WINAPI UnlockFileEx(HANDLE hFile, DWORD dwReserved,
  2144.                              DWORD nNumberOfBytesToUnlockLow,
  2145.                              DWORD nNumberOfBytesToUnlockHigh,
  2146.                              LPOVERLAPPED lpOverlapped);
  2147.  
  2148.     */
  2149.  
  2150.     [
  2151.     usesgetlasterror,
  2152.     entry("GetFileInformationByHandle"),
  2153.     helpstring("Retrieves information about the specified file"),
  2154.     ]
  2155.     BOOL WINAPI GetFileInformationByHandle(HANDLE hFile,
  2156.                 LPVOID lpFileInformation);
  2157.  
  2158.     [
  2159.     usesgetlasterror,
  2160.     entry("GetFileType"),
  2161.     helpstring("Returns the type of the specified file"),
  2162.     ]
  2163.     DWORD WINAPI GetFileType(HANDLE hFile);
  2164.  
  2165.     [
  2166.     usesgetlasterror,
  2167.     entry("GetFileSize"),
  2168.     helpstring("Retrieves the size, in bytes, of the specified file"),
  2169.     ]
  2170.     DWORD WINAPI GetFileSize(HANDLE hFile, 
  2171.                              DWORD * lpFileSizeHigh);
  2172.  
  2173.     [
  2174.     usesgetlasterror,
  2175.     entry("GetStdHandle"),
  2176.     helpstring("Returns handle for standard input, standard output, or standard error device"),
  2177.     ]
  2178.     HANDLE WINAPI GetStdHandle(DWORD nStdHandle);
  2179.  
  2180.     [
  2181.     usesgetlasterror,
  2182.     entry("SetStdHandle"),
  2183.     helpstring("Sets handle for standard input, standard output, or standard error device"),
  2184.     ]
  2185.     BOOL WINAPI SetStdHandle(DWORD nStdHandle, 
  2186.                              HANDLE hHandle);
  2187.  
  2188.     [
  2189.     usesgetlasterror,
  2190.     entry("WriteFile"),
  2191.     helpstring("Writes data to a file handle, synchonously or asynchronously, starting at the position indicated by the file pointer"),
  2192.     ]
  2193.     BOOL WINAPI WriteFile(HANDLE hFile,
  2194.                           LPVOID lpBuffer,
  2195.                           DWORD nNumberOfBytesToWrite,
  2196.                           DWORD * lpNumberOfBytesWritten,
  2197.                           LPVOID lpOverlapped);
  2198.  
  2199.     [
  2200.     usesgetlasterror,
  2201.     entry("ReadFile"),
  2202.     helpstring("Reads data from a file handle, starting at the position indicated by the file pointer"),
  2203.     ]
  2204.     BOOL WINAPI ReadFile(HANDLE hFile,
  2205.                          LPVOID lpBuffer,
  2206.                          DWORD nNumberOfBytesToRead,
  2207.                          DWORD * lpNumberOfBytesRead,
  2208.                          LPVOID lpOverlapped);
  2209.  
  2210.     [
  2211.     usesgetlasterror,
  2212.     entry("WriteFile"),
  2213.     helpstring("Writes data to a file handle, synchonously or asynchronously, starting at the position indicated by the file pointer"),
  2214.     ]
  2215.     BOOL WINAPI WriteFileStr(HANDLE hFile,
  2216.                              LPTSTR lpBuffer,
  2217.                              DWORD nNumberOfBytesToWrite,
  2218.                              DWORD * lpNumberOfBytesWritten,
  2219.                              LPVOID lpOverlapped);
  2220.  
  2221.     [
  2222.     usesgetlasterror,
  2223.     entry("ReadFile"),
  2224.     helpstring("Reads data from a file handle, starting at the position indicated by the file pointer"),
  2225.     ]
  2226.     BOOL WINAPI ReadFileStr(HANDLE hFile,
  2227.                             LPTSTR lpBuffer,
  2228.                             DWORD nNumberOfBytesToRead,
  2229.                             DWORD * lpNumberOfBytesRead,
  2230.                             LPVOID lpOverlapped);
  2231.  
  2232.     [
  2233.     usesgetlasterror,
  2234.     entry("FlushFileBuffers"),
  2235.     helpstring("Writes file buffers for an open handle to disk"),
  2236.     ]
  2237.     BOOL WINAPI FlushFileBuffers(HANDLE hFile);
  2238.  
  2239.     /*
  2240.     BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode,
  2241.                                 LPVOID lpInBuffer, DWORD nInBufferSize,
  2242.                                 LPVOID lpOutBuffer, DWORD nOutBufferSize,
  2243.                                 LPDWORD lpBytesReturned,
  2244.                                 LPOVERLAPPED lpOverlapped);
  2245.     */
  2246.  
  2247.     [
  2248.     usesgetlasterror,
  2249.     entry("SetEndOfFile"),
  2250.     helpstring("Moves the end-of-file (EOF) position for a file to current position of file pointer"),
  2251.     ]
  2252.     BOOL WINAPI SetEndOfFile(HANDLE hFile);
  2253.  
  2254.     [
  2255.     usesgetlasterror,
  2256.     entry("SetFilePointer"),
  2257.     helpstring("Moves the file pointer of an open file"),
  2258.     ]
  2259.     DWORD WINAPI SetFilePointer(HANDLE hFile, 
  2260.                                 LONG lDistanceToMove,
  2261.                                 LONG * lpDistanceToMoveHigh,
  2262.                                 DWORD dwMoveMethod);
  2263.  
  2264.     [
  2265.     usesgetlasterror,
  2266.     entry("FindClose"),
  2267.     helpstring("Closes a file search started with FindFirstFile"),
  2268.     ]
  2269.     BOOL WINAPI FindClose(HANDLE hFindFile);
  2270.  
  2271.     [
  2272.     usesgetlasterror,
  2273.     entry("GetFileTime"),
  2274.     helpstring("Retrieves date and time that a file was created, last accessed, and last modified"),
  2275.     ]
  2276.     BOOL WINAPI GetFileTime(HANDLE hFile,
  2277.                             LPFILETIME lpCreationTime,
  2278.                             LPFILETIME lpLastAccessTime,
  2279.                             LPFILETIME lpLastWriteTime);
  2280.  
  2281.     [
  2282.     usesgetlasterror,
  2283.     entry("SetFileTime"),
  2284.     helpstring("Sets date and time that a file was created, last accessed, or last modified"),
  2285.     ]
  2286.     BOOL WINAPI SetFileTime(HANDLE hFile,
  2287.                             LPFILETIME lpCreationTime,
  2288.                             LPFILETIME lpLastAccessTime,
  2289.                             LPFILETIME lpLastWriteTime);
  2290.  
  2291.     [
  2292.     usesgetlasterror,
  2293.     entry("CloseHandle"),
  2294.     helpstring("Closes an object handle"),
  2295.     ]
  2296.     BOOL WINAPI CloseHandle(HANDLE hObject);
  2297.  
  2298.     [
  2299.     usesgetlasterror,
  2300.     entry("DuplicateHandle"),
  2301.     helpstring("Duplicates an object handle"),
  2302.     ]
  2303.     BOOL WINAPI DuplicateHandle(HANDLE hSourceProcessHandle,
  2304.                                 HANDLE hSourceHandle,
  2305.                                 HANDLE hTargetProcessHandle,
  2306.                                 HANDLE * lpTargetHandle,
  2307.                                 DWORD dwDesiredAccess,
  2308.                                 BOOL bInheritHandle, 
  2309.                                 DWORD dwOptions);
  2310.  
  2311.     [
  2312.     usesgetlasterror,
  2313.     entry("GetHandleInformation"),
  2314.     helpstring("Gets properties of an object handle in a bitflag"),
  2315.     ]
  2316.     BOOL WINAPI GetHandleInformation(HANDLE hObject, 
  2317.                                      DWORD * lpdwFlags);
  2318.  
  2319.     [
  2320.     usesgetlasterror,
  2321.     entry("SetHandleInformation"),
  2322.     helpstring("Sets properties of an object handle in a bitflag"),
  2323.     ]
  2324.     BOOL WINAPI SetHandleInformation(HANDLE hObject, 
  2325.                                      DWORD dwMask,
  2326.                                      DWORD dwFlags);
  2327.  
  2328.     /* Omitted
  2329.     DWORD WINAPI LoadModule(LPCTSTR lpModuleName, LPVOID lpParameterBlock);
  2330.     */
  2331.  
  2332.  
  2333.     [
  2334.     usesgetlasterror,
  2335.     entry("WinExec"),
  2336.     helpstring("Run an application"),
  2337.     ]
  2338.     UINT    WINAPI WinExec(LPCTSTR lpszCmdLine, UINT fuCmdShow);
  2339.  
  2340.     /* COMM omitted
  2341.     BOOL
  2342.     WINAPI
  2343.     ClearCommBreak(
  2344.         HANDLE hFile
  2345.         );
  2346.  
  2347.     BOOL
  2348.     WINAPI
  2349.     ClearCommError(
  2350.         HANDLE hFile,
  2351.         LPDWORD lpErrors,
  2352.         LPCOMSTAT lpStat
  2353.         );
  2354.  
  2355.     BOOL
  2356.     WINAPI
  2357.     SetupComm(
  2358.         HANDLE hFile,
  2359.         DWORD dwInQueue,
  2360.         DWORD dwOutQueue
  2361.         );
  2362.  
  2363.     BOOL
  2364.     WINAPI
  2365.     EscapeCommFunction(
  2366.         HANDLE hFile,
  2367.         DWORD dwFunc
  2368.         );
  2369.  
  2370.     BOOL
  2371.     WINAPI
  2372.     GetCommConfig(
  2373.         HANDLE hCommDev,
  2374.         LPCOMMCONFIG lpCC,
  2375.         LPDWORD lpdwSize
  2376.         );
  2377.  
  2378.     BOOL
  2379.     WINAPI
  2380.     GetCommMask(
  2381.         HANDLE hFile,
  2382.         LPDWORD lpEvtMask
  2383.         );
  2384.  
  2385.     BOOL
  2386.     WINAPI
  2387.     GetCommProperties(
  2388.         HANDLE hFile,
  2389.         LPCOMMPROP lpCommProp
  2390.         );
  2391.  
  2392.     BOOL
  2393.     WINAPI
  2394.     GetCommModemStatus(
  2395.         HANDLE hFile,
  2396.         LPDWORD lpModemStat
  2397.         );
  2398.  
  2399.     BOOL
  2400.     WINAPI
  2401.     GetCommState(
  2402.         HANDLE hFile,
  2403.         LPDCB lpDCB
  2404.         );
  2405.  
  2406.     BOOL
  2407.     WINAPI
  2408.     GetCommTimeouts(
  2409.         HANDLE hFile,
  2410.         LPCOMMTIMEOUTS lpCommTimeouts
  2411.         );
  2412.  
  2413.     BOOL
  2414.     WINAPI
  2415.     PurgeComm(
  2416.         HANDLE hFile,
  2417.         DWORD dwFlags
  2418.         );
  2419.  
  2420.     BOOL
  2421.     WINAPI
  2422.     SetCommBreak(
  2423.         HANDLE hFile
  2424.         );
  2425.  
  2426.     BOOL
  2427.     WINAPI
  2428.     SetCommConfig(
  2429.         HANDLE hCommDev,
  2430.         LPCOMMCONFIG lpCC,
  2431.         DWORD dwSize
  2432.         );
  2433.  
  2434.     BOOL
  2435.     WINAPI
  2436.     SetCommMask(
  2437.         HANDLE hFile,
  2438.         DWORD dwEvtMask
  2439.         );
  2440.  
  2441.     BOOL
  2442.     WINAPI
  2443.     SetCommState(
  2444.         HANDLE hFile,
  2445.         LPDCB lpDCB
  2446.         );
  2447.  
  2448.     BOOL
  2449.     WINAPI
  2450.     SetCommTimeouts(
  2451.         HANDLE hFile,
  2452.         LPCOMMTIMEOUTS lpCommTimeouts
  2453.         );
  2454.  
  2455.     BOOL
  2456.     WINAPI
  2457.     TransmitCommChar(
  2458.         HANDLE hFile,
  2459.         char cChar
  2460.         );
  2461.  
  2462.     BOOL
  2463.     WINAPI
  2464.     WaitCommEvent(
  2465.         HANDLE hFile,
  2466.         LPDWORD lpEvtMask,
  2467.         LPOVERLAPPED lpOverlapped
  2468.         );
  2469.     */
  2470.  
  2471.     /* Tape omitted
  2472.     DWORD WINAPI SetTapePosition(
  2473.         HANDLE hDevice,
  2474.         DWORD  dwPositionMethod,
  2475.         DWORD  dwPartition,
  2476.         DWORD  dwOffsetLow,
  2477.         DWORD  dwOffsetHigh,
  2478.         BOOL bImmediate
  2479.         );
  2480.  
  2481.     DWORD WINAPI GetTapePosition(
  2482.         HANDLE hDevice,
  2483.         DWORD  dwPositionType,
  2484.         DWORD * lpdwPartition,
  2485.         DWORD * lpdwOffsetLow,
  2486.         DWORD * lpdwOffsetHigh
  2487.         );
  2488.  
  2489.     DWORD WINAPI PrepareTape(
  2490.         HANDLE hDevice,
  2491.         DWORD  dwOperation,
  2492.         BOOL bImmediate
  2493.         );
  2494.  
  2495.     DWORD WINAPI EraseTape(
  2496.         HANDLE hDevice,
  2497.         DWORD  dwEraseType,
  2498.         BOOL bImmediate
  2499.         );
  2500.  
  2501.     DWORD WINAPI CreateTapePartition(
  2502.         HANDLE hDevice,
  2503.         DWORD  dwPartitionMethod,
  2504.         DWORD  dwCount,
  2505.         DWORD  dwSize
  2506.         );
  2507.  
  2508.     DWORD WINAPI WriteTapemark(
  2509.         HANDLE hDevice,
  2510.         DWORD  dwTapemarkType,
  2511.         DWORD  dwTapemarkCount,
  2512.         BOOL bImmediate
  2513.         );
  2514.  
  2515.     DWORD WINAPI GetTapeStatus(
  2516.         HANDLE hDevice
  2517.         );
  2518.  
  2519.     DWORD WINAPI GetTapeParameters(
  2520.         HANDLE hDevice,
  2521.         DWORD  dwOperation,
  2522.         DWORD * lpdwSize,
  2523.         LPVOID lpTapeInformation
  2524.         );
  2525.  
  2526.     //const int GET_TAPE_MEDIA_INFORMATION = 0;
  2527.     //const int GET_TAPE_DRIVE_INFORMATION = 1;
  2528.  
  2529.     DWORD WINAPI SetTapeParameters(
  2530.         HANDLE hDevice,
  2531.         DWORD  dwOperation,
  2532.         LPVOID lpTapeInformation
  2533.         );
  2534.  
  2535.     //const int SET_TAPE_MEDIA_INFORMATION = 0;
  2536.     //const int SET_TAPE_DRIVE_INFORMATION = 1;
  2537.     */
  2538.  
  2539.     [
  2540.     usesgetlasterror,
  2541.     entry("Beep"),
  2542.     helpstring("Plays a sound of given frequency and duration"),
  2543.     ]
  2544.     BOOL WINAPI Beep(DWORD dwFreq, DWORD dwDuration);
  2545.  
  2546.     /* Sound omitted
  2547.     WINBASEAPI
  2548.     VOID
  2549.     WINAPI
  2550.     OpenSound(
  2551.         VOID
  2552.         );
  2553.  
  2554.     WINBASEAPI
  2555.     VOID
  2556.     WINAPI
  2557.     CloseSound(
  2558.         VOID
  2559.         );
  2560.  
  2561.     WINBASEAPI
  2562.     VOID
  2563.     WINAPI
  2564.     StartSound(
  2565.         VOID
  2566.         );
  2567.  
  2568.     WINBASEAPI
  2569.     VOID
  2570.     WINAPI
  2571.     StopSound(
  2572.         VOID
  2573.         );
  2574.  
  2575.     WINBASEAPI
  2576.     DWORD
  2577.     WINAPI
  2578.     WaitSoundState(
  2579.         DWORD nState
  2580.         );
  2581.  
  2582.     WINBASEAPI
  2583.     DWORD
  2584.     WINAPI
  2585.     SyncAllVoices(
  2586.         VOID
  2587.         );
  2588.  
  2589.     WINBASEAPI
  2590.     DWORD
  2591.     WINAPI
  2592.     CountVoiceNotes(
  2593.         DWORD nVoice
  2594.         );
  2595.  
  2596.     WINBASEAPI
  2597.     LPDWORD
  2598.     WINAPI
  2599.     GetThresholdEvent(
  2600.         VOID
  2601.         );
  2602.  
  2603.     WINBASEAPI
  2604.     DWORD
  2605.     WINAPI
  2606.     GetThresholdStatus(
  2607.         VOID
  2608.         );
  2609.  
  2610.     WINBASEAPI
  2611.     DWORD
  2612.     WINAPI
  2613.     SetSoundNoise(
  2614.         DWORD nSource,
  2615.         DWORD nDuration
  2616.         );
  2617.  
  2618.     WINBASEAPI
  2619.     DWORD
  2620.     WINAPI
  2621.     SetVoiceAccent(
  2622.         DWORD nVoice,
  2623.         DWORD nTempo,
  2624.         DWORD nVolume,
  2625.         DWORD nMode,
  2626.         DWORD nPitch
  2627.         );
  2628.  
  2629.     WINBASEAPI
  2630.     DWORD
  2631.     WINAPI
  2632.     SetVoiceEnvelope(
  2633.         DWORD nVoice,
  2634.         DWORD nShape,
  2635.         DWORD nRepeat
  2636.         );
  2637.  
  2638.     WINBASEAPI
  2639.     DWORD
  2640.     WINAPI
  2641.     SetVoiceNote(
  2642.         DWORD nVoice,
  2643.         DWORD nValue,
  2644.         DWORD nLength,
  2645.         DWORD nCdots
  2646.         );
  2647.  
  2648.     WINBASEAPI
  2649.     DWORD
  2650.     WINAPI
  2651.     SetVoiceQueueSize(
  2652.         DWORD nVoice,
  2653.         DWORD nBytes
  2654.         );
  2655.  
  2656.     WINBASEAPI
  2657.     DWORD
  2658.     WINAPI
  2659.     SetVoiceSound(
  2660.         DWORD nVoice,
  2661.         DWORD Frequency,
  2662.         DWORD nDuration
  2663.         );
  2664.  
  2665.     WINBASEAPI
  2666.     DWORD
  2667.     WINAPI
  2668.     SetVoiceThreshold(
  2669.         DWORD nVoice,
  2670.         DWORD nNotes
  2671.         );
  2672.     */
  2673.  
  2674.     /*
  2675.     int WINAPI MulDiv(int nNumber, int nNumerator, int nDenominator);
  2676.     */
  2677.  
  2678.     [
  2679.     usesgetlasterror,
  2680.     entry("GetSystemTime"),
  2681.     helpstring("Gets the current system time and date"),
  2682.     ]
  2683.     void WINAPI GetSystemTime(SYSTEMTIME * lpSystemTime);
  2684.  
  2685.     [
  2686.     usesgetlasterror,
  2687.     entry("SetSystemTime"),
  2688.     helpstring("Sets the current system time and date"),
  2689.     ]
  2690.     BOOL WINAPI SetSystemTime(SYSTEMTIME * lpSystemTime);
  2691.  
  2692.     [
  2693.     usesgetlasterror,
  2694.     entry("GetLocalTime"),
  2695.     helpstring("Sets the current local time and date"),
  2696.     ]
  2697.     void WINAPI GetLocalTime(SYSTEMTIME * lpSystemTime);
  2698.  
  2699.     [
  2700.     usesgetlasterror,
  2701.     entry("SetLocalTime"),
  2702.     helpstring("Sets the current local time and date"),
  2703.     ]
  2704.     BOOL WINAPI SetLocalTime(SYSTEMTIME * lpSystemTime);
  2705.  
  2706.     [
  2707.     usesgetlasterror,
  2708.     entry("GetSystemInfo"),
  2709.     helpstring("Returns information about the current system"),
  2710.     ]
  2711.     void WINAPI GetSystemInfo(SYSTEM_INFO * lpSystemInfo);
  2712.  
  2713.     const LONG PROCESSOR_INTEL_386     = 386;
  2714.     const LONG PROCESSOR_INTEL_486     = 486;
  2715.     const LONG PROCESSOR_INTEL_PENTIUM = 586;
  2716.     const LONG PROCESSOR_MIPS_R4000    = 4000;
  2717.     const LONG PROCESSOR_ALPHA_21064   = 21064;
  2718.  
  2719.     const LONG PROCESSOR_ARCHITECTURE_INTEL = 0;
  2720.     const LONG PROCESSOR_ARCHITECTURE_MIPS  = 1;
  2721.     const LONG PROCESSOR_ARCHITECTURE_ALPHA = 2;
  2722.     const LONG PROCESSOR_ARCHITECTURE_PPC   = 3;
  2723.     const LONG PROCESSOR_ARCHITECTURE_UNKNOWN = 0xFFFF;
  2724.  
  2725.     /*
  2726.     BOOL WINAPI SystemTimeToTzSpecificLocalTime(
  2727.         LPTIME_ZONE_INFORMATION lpTimeZoneInformation,
  2728.         LPSYSTEMTIME lpUniversalTime,
  2729.         LPSYSTEMTIME lpLocalTime
  2730.         );
  2731.  
  2732.     DWORD WINAPI GetTimeZoneInformation(
  2733.         LPTIME_ZONE_INFORMATION lpTimeZoneInformation
  2734.         );
  2735.  
  2736.     BOOL WINAPI SetTimeZoneInformation(
  2737.         CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation
  2738.         );
  2739.     */
  2740.  
  2741.     //
  2742.     // Routines to convert back and forth between system time and file time
  2743.     //
  2744.  
  2745.     [
  2746.     usesgetlasterror,
  2747.     entry("SystemTimeToFileTime"),
  2748.     helpstring("Converts a system time to a file time"),
  2749.     ]
  2750.     BOOL WINAPI SystemTimeToFileTime(SYSTEMTIME * lpSystemTime,
  2751.                                      LPFILETIME lpFileTime);
  2752.  
  2753.     [
  2754.     usesgetlasterror,
  2755.     entry("FileTimeToLocalFileTime"),
  2756.     helpstring("Converts a UTC file time to a local file time"),
  2757.     ]
  2758.     BOOL WINAPI FileTimeToLocalFileTime(LPFILETIME lpFileTime,
  2759.                                         LPFILETIME lpLocalFileTime);
  2760.  
  2761.     [
  2762.     usesgetlasterror,
  2763.     entry("LocalFileTimeToFileTime"),
  2764.     helpstring("Converts a local file time to a UTC file time"),
  2765.     ]
  2766.     BOOL WINAPI LocalFileTimeToFileTime(LPFILETIME lpLocalFileTime,
  2767.                                         LPFILETIME lpFileTime);
  2768.  
  2769.     [
  2770.     usesgetlasterror,
  2771.     entry("FileTimeToSystemTime"),
  2772.     helpstring("Converts a file time to a system time"),
  2773.     ]
  2774.     BOOL WINAPI FileTimeToSystemTime(LPFILETIME lpFileTime,
  2775.                                      SYSTEMTIME * lpSystemTime);
  2776.  
  2777.     [
  2778.     usesgetlasterror,
  2779.     entry("CompareFileTime"),
  2780.     helpstring("Compares two file times and returns -1, 0, or 1 depending on the result"),
  2781.     ]
  2782.     LONG WINAPI CompareFileTime(LPFILETIME lpFileTime1,
  2783.                                 LPFILETIME lpFileTime2);
  2784.  
  2785.     [
  2786.     usesgetlasterror,
  2787.     entry("FileTimeToDosDateTime"),
  2788.     helpstring(""),
  2789.     ]
  2790.     BOOL WINAPI FileTimeToDosDateTime(LPFILETIME lpFileTime,
  2791.                                       WORD * lpFatDate,
  2792.                                       WORD * lpFatTime);
  2793.  
  2794.     [
  2795.     usesgetlasterror,
  2796.     entry("DosDateTimeToFileTime"),
  2797.     helpstring(""),
  2798.     ]
  2799.     BOOL WINAPI DosDateTimeToFileTime(WORD wFatDate,
  2800.                                       WORD wFatTime,
  2801.                                       LPFILETIME lpFileTime);
  2802.  
  2803.     [
  2804.     usesgetlasterror,
  2805.     entry("GetTickCount"),
  2806.     helpstring("Returns milliseconds since Windows was started"),
  2807.     ]
  2808.     DWORD   WINAPI GetTickCount(void);
  2809.  
  2810.     [
  2811.     usesgetlasterror,
  2812.     entry("GetTickCount"),
  2813.     helpstring("Returns milliseconds since Windows was started"),
  2814.     ]
  2815.     DWORD   WINAPI GetCurrentTime(void);
  2816.  
  2817.     [
  2818.     usesgetlasterror,
  2819.     entry("SetSystemTimeAdjustment"),
  2820.     helpstring(""),
  2821.     ]
  2822.     BOOL WINAPI SetSystemTimeAdjustment(DWORD dwTimeAdjustment,
  2823.                                         BOOL  bTimeAdjustmentDisabled);
  2824.  
  2825.     [
  2826.     usesgetlasterror,
  2827.     entry("GetSystemTimeAdjustment"),
  2828.     helpstring(""),
  2829.     ]
  2830.     BOOL WINAPI GetSystemTimeAdjustment(DWORD * lpTimeAdjustment,
  2831.                                         DWORD * lpTimeIncrement,
  2832.                                         BOOL  * lpTimeAdjustmentDisabled);
  2833.  
  2834.     [
  2835.     usesgetlasterror,
  2836.     #ifdef UNICODE
  2837.     entry("FormatMessageW"),
  2838.     #else
  2839.     entry("FormatMessageA"),
  2840.     #endif
  2841.     helpstring("Formats a message string from a message definition (usally located in a DLL)"),
  2842.     ]
  2843.     DWORD WINAPI FormatMessage(
  2844.         EFORMAT_MESSAGE dwFlags,
  2845.         DWORD /* LPVOID */ lpSource,
  2846.         DWORD dwMessageId,
  2847.         DWORD dwLanguageId,
  2848.         LPTSTR lpBuffer,
  2849.         DWORD nSize,
  2850.         LPVOID /* va_list * */ Arguments);
  2851.  
  2852.     [
  2853.     usesgetlasterror,
  2854.     entry("CreatePipe"),
  2855.     helpstring("Creates an anonymous pipe, and returns handles to the read and write ends of the pipe (null security)"),
  2856.     ]
  2857.     BOOL WINAPI CreatePipe(HANDLE * hReadPipe,
  2858.                            HANDLE * hWritePipe,
  2859.                            LPSECURITY_ATTRIBUTES lpPipeAttributes,
  2860.                            DWORD nSize);
  2861.     [
  2862.     usesgetlasterror,
  2863.     entry("ConnectNamedPipe"),
  2864.     helpstring("Enables a named pipe server process to wait for a client process to connect to an instance of a named pipe"),
  2865.     ]
  2866.     BOOL WINAPI ConnectNamedPipe(HANDLE hNamedPipe,
  2867.                                  DWORD /* OVERLAPPED * */ lpOverlapped);
  2868.  
  2869.     [
  2870.     usesgetlasterror,
  2871.     entry("DisconnectNamedPipe"),
  2872.     helpstring("Disconnects the server end of a named pipe instance from a client process"),
  2873.     ]
  2874.     BOOL WINAPI DisconnectNamedPipe(HANDLE hNamedPipe);
  2875.  
  2876.     [
  2877.     usesgetlasterror,
  2878.     entry("SetNamedPipeHandleState"),
  2879.     helpstring("Sets the read mode and the blocking mode of the specified named pipe"),
  2880.     ]
  2881.     BOOL WINAPI SetNamedPipeHandleState(HANDLE hNamedPipe,
  2882.                                         LPDWORD lpMode,
  2883.                                         DWORD * lpMaxCollectionCount,
  2884.                                         DWORD * lpCollectDataTimeout);
  2885.  
  2886.     [
  2887.     usesgetlasterror,
  2888.     entry("GetNamedPipeInfo"),
  2889.     helpstring("Retrieves information about the specified named pipe"),
  2890.     ]
  2891.     BOOL WINAPI GetNamedPipeInfo(HANDLE hNamedPipe,
  2892.                                  DWORD * lpFlags,
  2893.                                  DWORD * lpOutBufferSize,
  2894.                                  DWORD * lpInBufferSize,
  2895.                                  DWORD * lpMaxInstances);
  2896.  
  2897.     [
  2898.     usesgetlasterror,
  2899.     entry("PeekNamedPipe"),
  2900.     helpstring("Copies data from a named or anonymous pipe into a buffer without removing it from the pipe; also returns information about data in the pipe"),
  2901.     ]
  2902.     BOOL WINAPI PeekNamedPipeStr(HANDLE hNamedPipe,
  2903.                                  LPTSTR lpBuffer,
  2904.                                  DWORD  nBufferSize,
  2905.                                  DWORD * lpBytesRead,
  2906.                                  DWORD * lpTotalBytesAvail,
  2907.                                  DWORD * lpBytesLeftThisMessage);
  2908.     [
  2909.     usesgetlasterror,
  2910.     entry("PeekNamedPipe"),
  2911.     helpstring("Copies data from a named or anonymous pipe into a buffer without removing it from the pipe; also returns information about data in the pipe"),
  2912.     ]
  2913.     BOOL WINAPI PeekNamedPipe(HANDLE hNamedPipe,
  2914.                               LPVOID lpBuffer,
  2915.                               DWORD  nBufferSize,
  2916.                               DWORD * lpBytesRead,
  2917.                               DWORD * lpTotalBytesAvail,
  2918.                               DWORD * lpBytesLeftThisMessage);
  2919.  
  2920.     [
  2921.     usesgetlasterror,
  2922.     entry("TransactNamedPipe"),
  2923.     helpstring("Combines into a single network operation the functions that write a message to and read a message from the specified named pipe"),
  2924.     ]
  2925.     BOOL WINAPI TransactNamedPipeStr(HANDLE hNamedPipe,
  2926.                                      LPTSTR lpInBuffer,
  2927.                                      DWORD  nInBufferSize,
  2928.                                      LPTSTR lpOutBuffer,
  2929.                                      DWORD  nOutBufferSize,
  2930.                                      DWORD * lpBytesRead,
  2931.                                      DWORD /* OVERLAPPED * */ lpOverlapped);
  2932.  
  2933.     [
  2934.     usesgetlasterror,
  2935.     entry("TransactNamedPipe"),
  2936.     helpstring("Combines into a single network operation the functions that write a message to and read a message from the specified named pipe"),
  2937.     ]
  2938.     BOOL WINAPI TransactNamedPipe(HANDLE hNamedPipe,
  2939.                                   LPTSTR lpInBuffer,
  2940.                                   DWORD  nInBufferSize,
  2941.                                   LPTSTR lpOutBuffer,
  2942.                                   DWORD  nOutBufferSize,
  2943.                                   DWORD * lpBytesRead,
  2944.                                   DWORD /* OVERLAPPED * */ lpOverlapped);
  2945.  
  2946.     [
  2947.     usesgetlasterror,
  2948.     #ifdef UNICODE
  2949.     entry("CreateMailslotW"),
  2950.     #else
  2951.     entry("CreateMailslotA"),
  2952.     #endif
  2953.     helpstring(""),
  2954.     ]
  2955.     HANDLE WINAPI CreateMailslot(LPCTSTR lpName,
  2956.                                  DWORD  nMaxMessageSize,
  2957.                                  DWORD  lReadTimeout,
  2958.                                  DWORD /* SECURITY_ATTRIBUTES */ lpSecurityAttributes
  2959.                                  );
  2960.  
  2961.     [
  2962.     usesgetlasterror,
  2963.     #ifdef UNICODE
  2964.     entry("CreateMailslotW"),
  2965.     #else
  2966.     entry("CreateMailslotA"),
  2967.     #endif
  2968.     helpstring(""),
  2969.     ]
  2970.     HANDLE WINAPI CreateMailslotSec(LPCTSTR lpName,
  2971.                                     DWORD  nMaxMessageSize,
  2972.                                     DWORD  lReadTimeout,
  2973.                                     SECURITY_ATTRIBUTES * lpSecurityAttributes
  2974.                                     );
  2975.  
  2976.     [
  2977.     usesgetlasterror,
  2978.     entry("GetMailslotInfo"),
  2979.     helpstring(""),
  2980.     ]
  2981.     BOOL WINAPI GetMailslotInfo(
  2982.         HANDLE hMailslot,
  2983.         DWORD * lpMaxMessageSize,
  2984.         DWORD * lpNextSize,
  2985.         DWORD * lpMessageCount,
  2986.         DWORD * lpReadTimeout
  2987.         );
  2988.  
  2989.     [
  2990.     usesgetlasterror,
  2991.     entry("SetMailslotInfo"),
  2992.     helpstring(""),
  2993.     ]
  2994.     BOOL WINAPI SetMailslotInfo(
  2995.         HANDLE hMailslot,
  2996.         DWORD  lReadTimeout
  2997.         );
  2998.  
  2999.     [
  3000.     usesgetlasterror,
  3001.     entry("FlushViewOfFile"),
  3002.     helpstring("Writes file mapping to disk"),
  3003.     ]
  3004.     BOOL WINAPI FlushViewOfFile(
  3005.         LPCvoid lpBaseAddress,
  3006.         DWORD dwNumberOfBytesToFlush
  3007.         );
  3008.  
  3009.     [
  3010.     usesgetlasterror,
  3011.     entry("MapViewOfFile"),
  3012.     helpstring("Opens view of specified file mapping"),
  3013.     ]
  3014.     LONG WINAPI MapViewOfFile(
  3015.         HANDLE hFileMappingObject,
  3016.         DWORD dwDesiredAccess,
  3017.         DWORD dwFileOffsetHigh,
  3018.         DWORD dwFileOffsetLow,
  3019.         DWORD dwNumberOfBytesToMap
  3020.         );
  3021.  
  3022.     [
  3023.     usesgetlasterror,
  3024.     entry("UnmapViewOfFile"),
  3025.     helpstring("Releases file mapping"),
  3026.     ]
  3027.     BOOL WINAPI UnmapViewOfFile(
  3028.         LPVOID lpBaseAddress
  3029.         );
  3030.  
  3031.     // String functions
  3032.     [
  3033.     usesgetlasterror,
  3034.     #ifdef UNICODE
  3035.     entry("lstrcmpW"),
  3036.     #else
  3037.     entry("lstrcmpA"),
  3038.     #endif
  3039.     helpstring("Compares two strings (case sensitive) and returns less than zero if first string is less, zero if strings are equal, or greater than zero if first string is greater"),
  3040.     ]
  3041.     int     WINAPI lstrcmp(LPCTSTR lpszString1,
  3042.                            LPCTSTR lpszString2);
  3043.  
  3044.     [
  3045.     usesgetlasterror,
  3046.     #ifdef UNICODE
  3047.     entry("lstrcmpW"),
  3048.     #else
  3049.     entry("lstrcmpA"),
  3050.     #endif
  3051.     helpstring("Compares two strings (case sensitive) and returns less than zero if first string is less, zero if strings are equal, or greater than zero if first string is greater"),
  3052.     ]
  3053.     int     WINAPI lstrcmpStrVar(LPCTSTR lpszString1,
  3054.                                  LONG lpszString2);
  3055.  
  3056.     [
  3057.     usesgetlasterror,
  3058.     #ifdef UNICODE
  3059.     entry("lstrcmpW"),
  3060.     #else
  3061.     entry("lstrcmpA"),
  3062.     #endif
  3063.     helpstring("Compares two strings (case sensitive) and returns less than zero if first string is less, zero if strings are equal, or greater than zero if first string is greater"),
  3064.     ]
  3065.     int     WINAPI lstrcmpPtrStr(LONG lpszString1,
  3066.                                  LPCTSTR lpszString2);
  3067.  
  3068.     [
  3069.     usesgetlasterror,
  3070.     #ifdef UNICODE
  3071.     entry("lstrcmpW"),
  3072.     #else
  3073.     entry("lstrcmpA"),
  3074.     #endif
  3075.     helpstring("Compares two strings (case sensitive) and returns less than zero if first string is less, zero if strings are equal, or greater than zero if first string is greater"),
  3076.     ]
  3077.     int     WINAPI lstrcmpPtrPtr(LONG lpszString1,
  3078.                                  LONG lpszString2);
  3079.  
  3080.     [
  3081.     usesgetlasterror,
  3082.     #ifdef UNICODE
  3083.     entry("lstrcmpiW"),
  3084.     #else
  3085.     entry("lstrcmpiA"),
  3086.     #endif
  3087.     helpstring("Compares two strings (case insensitive) and returns less than zero if first string is less, zero if strings are equal, or greater than zero if first string is greater"),
  3088.     ]
  3089.     int     WINAPI lstrcmpi(LPCTSTR lpszString1,
  3090.                             LPCTSTR lpszString2);
  3091.  
  3092.     [
  3093.     usesgetlasterror,
  3094.     #ifdef UNICODE
  3095.     entry("lstrcmpiW"),
  3096.     #else
  3097.     entry("lstrcmpiA"),
  3098.     #endif
  3099.     helpstring("Compares two strings (case insensitive) and returns less than zero if first string is less, zero if strings are equal, or greater than zero if first string is greater"),
  3100.     ]
  3101.     int     WINAPI lstrcmpiPtrPtr(LONG lpszString1,
  3102.                                   LONG lpszString2);
  3103.     
  3104.     [
  3105.     usesgetlasterror,
  3106.     #ifdef UNICODE
  3107.     entry("lstrcmpiW"),
  3108.     #else
  3109.     entry("lstrcmpiA"),
  3110.     #endif
  3111.     helpstring("Compares two strings (case insensitive) and returns less than zero if first string is less, zero if strings are equal, or greater than zero if first string is greater"),
  3112.     ]
  3113.     int     WINAPI lstrcmpiPtrStr(LONG lpszString1,
  3114.                                   LPCTSTR lpszString2);
  3115.  
  3116.     [
  3117.     usesgetlasterror,
  3118.     #ifdef UNICODE
  3119.     entry("lstrcmpiW"),
  3120.     #else
  3121.     entry("lstrcmpiA"),
  3122.     #endif
  3123.     helpstring("Compares two strings (case insensitive) and returns less than zero if first string is less, zero if strings are equal, or greater than zero if first string is greater"),
  3124.     ]
  3125.     int     WINAPI lstrcmpiStrPtr(LPCTSTR lpszString1,
  3126.                                   LONG lpszString2);
  3127.  
  3128.     [
  3129.     usesgetlasterror,
  3130.     #ifdef UNICODE
  3131.     entry("lstrcpynW"),
  3132.     #else
  3133.     entry("lstrcpynA"),
  3134.     #endif
  3135.     helpstring("Copies given count of characters from source string to destination and returns pointer to result"),
  3136.     ]
  3137.     LONG    WINAPI lstrcpyn(LPTSTR lpszDst, LPCTSTR lpszSrc,
  3138.                             int cChars);
  3139.  
  3140.     [
  3141.     usesgetlasterror,
  3142.     #ifdef UNICODE
  3143.     entry("lstrcpynW"),
  3144.     #else
  3145.     entry("lstrcpynA"),
  3146.     #endif
  3147.     helpstring("Copies given count of characters from source string to destination and returns pointer to result"),
  3148.     ]
  3149.     LONG    WINAPI lstrcpynStrPtr(LPTSTR lpszDst, LONG lpszSrc,
  3150.                                   int cChars);
  3151.     [
  3152.     usesgetlasterror,
  3153.     #ifdef UNICODE
  3154.     entry("lstrcpynW"),
  3155.     #else
  3156.     entry("lstrcpynA"),
  3157.     #endif
  3158.     helpstring("Copies given count of characters from source string to destination and returns pointer to result"),
  3159.     ]
  3160.     LONG    WINAPI lstrcpynPtrStr(LONG lpszDst, LPCTSTR lpszSrc,
  3161.                                   int cChars);
  3162.     [
  3163.     usesgetlasterror,
  3164.     #ifdef UNICODE
  3165.     entry("lstrcpynW"),
  3166.     #else
  3167.     entry("lstrcpynA"),
  3168.     #endif
  3169.     helpstring("Copies given count of characters from source string to destination and returns pointer to result"),
  3170.     ]
  3171.     LONG    WINAPI lstrcpynPtrPtr(LONG lpszDst, LONG lpszSrc,
  3172.                                   int cChars);
  3173.  
  3174.     [
  3175.     usesgetlasterror,
  3176.     #ifdef UNICODE
  3177.     entry("lstrcpyW"),
  3178.     #else
  3179.     entry("lstrcpyA"),
  3180.     #endif
  3181.     helpstring("Copies source string to destination and returns pointer to result"),
  3182.     ]
  3183.     LONG    WINAPI lstrcpy(LPTSTR lpszDst, LPCTSTR lpszSrc);
  3184.  
  3185.     [
  3186.     usesgetlasterror,
  3187.     #ifdef UNICODE
  3188.     entry("lstrcpyW"),
  3189.     #else
  3190.     entry("lstrcpyA"),
  3191.     #endif
  3192.     helpstring("Copies source string to destination and returns pointer to result"),
  3193.     ]
  3194.     LONG    WINAPI lstrcpyPtrStr(LONG lpszDst, LPCTSTR lpszSrc);
  3195.  
  3196.     [
  3197.     usesgetlasterror,
  3198.     #ifdef UNICODE
  3199.     entry("lstrcpyW"),
  3200.     #else
  3201.     entry("lstrcpyA"),
  3202.     #endif
  3203.     helpstring("Copies source string to destination and returns pointer to result"),
  3204.     ]
  3205.     LONG    WINAPI lstrcpyStrPtr(LPTSTR lpszDst, LONG lpszSrc);
  3206.  
  3207.     [
  3208.     usesgetlasterror,
  3209.     #ifdef UNICODE
  3210.     entry("lstrcpyW"),
  3211.     #else
  3212.     entry("lstrcpyA"),
  3213.     #endif
  3214.     helpstring("Copies source string to destination and returns pointer to result"),
  3215.     ]
  3216.     LONG    WINAPI lstrcpyPtrPtr(LONG lpszDst, LONG lpszSrc);
  3217.  
  3218.     [
  3219.     usesgetlasterror,
  3220.     #ifdef UNICODE
  3221.     entry("lstrcatW"),
  3222.     #else
  3223.     entry("lstrcatA"),
  3224.     #endif
  3225.     helpstring("Concatenates source string onto destination and returns pointer to result"),
  3226.     ]
  3227.     LONG    WINAPI lstrcat(LPTSTR lpszDst, LPCTSTR lpszSrc);
  3228.  
  3229.     [
  3230.     usesgetlasterror,
  3231.     #ifdef UNICODE
  3232.     entry("lstrcatW"),
  3233.     #else
  3234.     entry("lstrcatA"),
  3235.     #endif
  3236.     helpstring("Concatenates source string onto destination and returns pointer to result"),
  3237.     ]
  3238.     LONG    WINAPI lstrcatStrPtr(LPTSTR lpszDst, LONG lpszSrc);
  3239.  
  3240.     [
  3241.     usesgetlasterror,
  3242.     #ifdef UNICODE
  3243.     entry("lstrcatW"),
  3244.     #else
  3245.     entry("lstrcatA"),
  3246.     #endif
  3247.     helpstring("Concatenates source string onto destination and returns pointer to result"),
  3248.     ]
  3249.     LONG    WINAPI lstrcatPtrStr(LONG lpszDst, LPCTSTR lpszSrc);
  3250.  
  3251.     [
  3252.     usesgetlasterror,
  3253.     #ifdef UNICODE
  3254.     entry("lstrcatW"),
  3255.     #else
  3256.     entry("lstrcatA"),
  3257.     #endif
  3258.     helpstring("Concatenates source string onto destination and returns pointer to result"),
  3259.     ]
  3260.     LONG    WINAPI lstrcatPtrPtr(LONG lpszDst, LONG lpszSrc);
  3261.  
  3262.     [
  3263.     usesgetlasterror,
  3264.     #ifdef UNICODE
  3265.     entry("lstrlenW"),
  3266.     #else
  3267.     entry("lstrlenA"),
  3268.     #endif
  3269.     helpstring("Returns length of string (from string)"),
  3270.     ]
  3271.     int     WINAPI lstrlen(LPCTSTR lpsz);
  3272.  
  3273.     [
  3274.     usesgetlasterror,
  3275.     #ifdef UNICODE
  3276.     entry("lstrlenW"),
  3277.     #else
  3278.     entry("lstrlenA"),
  3279.     #endif
  3280.     helpstring("Returns length of string (from string)"),
  3281.     ]
  3282.     int     WINAPI lstrlenPtr(LONG lpsz);
  3283.  
  3284.     [
  3285.     usesgetlasterror,
  3286.     entry("OpenFile"),
  3287.     helpstring(""),
  3288.     ]
  3289.     HFILE WINAPI OpenFile(LPCTSTR lpFileName,
  3290.                           OFSTRUCT * lpReOpenBuff,
  3291.                           UINT uStyle);
  3292.  
  3293.     [
  3294.     usesgetlasterror,
  3295.     entry("_lopen"),
  3296.     helpstring("Opens a file"),
  3297.     ]
  3298.     HFILE   WINAPI lopen(LPCTSTR lpszFileName, int fnOpenMode);
  3299.  
  3300.     [
  3301.     usesgetlasterror,
  3302.     entry("_lcreat"),
  3303.     helpstring("Creates a file"),
  3304.     ]
  3305.     HFILE   WINAPI lcreat(LPCTSTR lpszFileName, int fnOpenMode);
  3306.  
  3307.     [
  3308.     usesgetlasterror,
  3309.     entry("_lread"),
  3310.     helpstring("Reads a buffer from a file"),
  3311.     ]
  3312.     UINT    WINAPI lread(HFILE hf, LPVOID lpBuffer, UINT cbBuffer);
  3313.  
  3314.     [
  3315.     usesgetlasterror,
  3316.     entry("_lread"),
  3317.     helpstring("Reads a buffer from a file"),
  3318.     ]
  3319.     UINT    WINAPI lreadStr(HFILE hf, LPTSTR lpBuffer, UINT cbBuffer);
  3320.  
  3321.     [
  3322.     usesgetlasterror,
  3323.     entry("_lwrite"),
  3324.     helpstring("Writes a buffer to a file"),
  3325.     ]
  3326.     UINT    WINAPI lwrite(HFILE hf, LPVOID lpBuffer, UINT cbBuffer);
  3327.  
  3328.     [
  3329.     usesgetlasterror,
  3330.     entry("_lwrite"),
  3331.     helpstring("Writes a buffer to a file"),
  3332.     ]
  3333.     UINT    WINAPI lwriteStr(HFILE hf, LPTSTR lpBuffer, UINT cbBuffer);
  3334.  
  3335.     /* Omitted
  3336.     long    WINAPI _hread(HFILE, void _huge*, long);
  3337.     long    WINAPI _hwrite(HFILE, const void _huge*, long);
  3338.     */
  3339.  
  3340.     [
  3341.     usesgetlasterror,
  3342.     entry("_lclose"),
  3343.     helpstring("Closes a file handle"),
  3344.     ]
  3345.     HFILE   WINAPI lclose(HFILE hf);
  3346.  
  3347.     [
  3348.     usesgetlasterror,
  3349.     entry("_llseek"),
  3350.     helpstring("Sets the seek position (see SEEK_SET)"),
  3351.     ]
  3352.     LONG    WINAPI llseek(HFILE hf, LONG lOffset, int nOrigin);
  3353.  
  3354.     /* TLS Not Implemented
  3355.     DWORD WINAPI TlsAlloc(
  3356.         void
  3357.         );
  3358.  
  3359.     //define TLS_OUT_OF_INDEXES (DWORD)0xFFFFFFFF
  3360.  
  3361.     LONG WINAPI TlsGetValue(
  3362.         DWORD  dwTlsIndex
  3363.         );
  3364.  
  3365.     BOOL WINAPI TlsSetValue(
  3366.         DWORD  dwTlsIndex,
  3367.         LPVOID lpTlsValue
  3368.         );
  3369.  
  3370.     BOOL WINAPI TlsFree(
  3371.         DWORD  dwTlsIndex
  3372.         );
  3373.     */
  3374.  
  3375.     /*
  3376.     DWORD WINAPI SleepEx(
  3377.         DWORD  dwMilliseconds,
  3378.         BOOL bAlertable
  3379.         );
  3380.  
  3381.     DWORD WINAPI WaitForSingleObjectEx(
  3382.         HANDLE hHandle,
  3383.         DWORD  dwMilliseconds,
  3384.         BOOL bAlertable
  3385.         );
  3386.  
  3387.     DWORD WINAPI WaitForMultipleObjectsEx(
  3388.         DWORD  nCount,
  3389.         CONST HANDLE *lpHandles,
  3390.         BOOL bWaitAll,
  3391.         DWORD  dwMilliseconds,
  3392.         BOOL bAlertable
  3393.         );
  3394.  
  3395.     BOOL WINAPI ReadFileEx(HANDLE hFile, LPVOID lpBuffer,
  3396.                            DWORD nNumberOfBytesToRead,
  3397.                            LPOVERLAPPED lpOverlapped,
  3398.                            LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
  3399.  
  3400.     BOOL WINAPI WriteFileEx(HANDLE hFile, LPCvoid lpBuffer,
  3401.                             DWORD nNumberOfBytesToWrite,
  3402.                             LPOVERLAPPED lpOverlapped,
  3403.                             LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
  3404.  
  3405.     */
  3406.  
  3407.     /* Backup omitted
  3408.     BOOL WINAPI BackupRead(
  3409.         HANDLE hFile,
  3410.         LPBYTE lpBuffer,
  3411.         DWORD  nNumberOfBytesToRead,
  3412.         DWORD * lpNumberOfBytesRead,
  3413.         BOOL bAbort,
  3414.         BOOL bProcessSecurity,
  3415.         LPVOID *lpContext
  3416.         );
  3417.  
  3418.     BOOL WINAPI BackupSeek(
  3419.         HANDLE hFile,
  3420.         DWORD   dwLowBytesToSeek,
  3421.         DWORD   dwHighBytesToSeek,
  3422.         DWORD * lpdwLowByteSeeked,
  3423.         DWORD * lpdwHighByteSeeked,
  3424.         LPVOID *lpContext
  3425.         );
  3426.  
  3427.     BOOL WINAPI BackupWrite(
  3428.         HANDLE hFile,
  3429.         LPBYTE lpBuffer,
  3430.         DWORD  nNumberOfBytesToWrite,
  3431.         DWORD * lpNumberOfBytesWritten,
  3432.         BOOL bAbort,
  3433.         BOOL bProcessSecurity,
  3434.         LPVOID *lpContext
  3435.         );
  3436.  
  3437.     */
  3438.  
  3439.     [
  3440.     usesgetlasterror,
  3441.     #ifdef UNICODE
  3442.     entry("CreateMutexW"),
  3443.     #else
  3444.     entry("CreateMutexA"),
  3445.     #endif
  3446.     helpstring(""),
  3447.     ]
  3448.     HANDLE WINAPI CreateMutex(
  3449.         DWORD /* SECURITY_ATTRIBUTES */ lpMutexAttributes,
  3450.         BOOL bInitialOwner,
  3451.         LPCTSTR lpName
  3452.         );
  3453.  
  3454.     [
  3455.     usesgetlasterror,
  3456.     #ifdef UNICODE
  3457.     entry("CreateMutexW"),
  3458.     #else
  3459.     entry("CreateMutexA"),
  3460.     #endif
  3461.     helpstring(""),
  3462.     ]
  3463.     HANDLE WINAPI CreateMutexSec(
  3464.         SECURITY_ATTRIBUTES * lpMutexAttributes,
  3465.         BOOL bInitialOwner,
  3466.         LPCTSTR lpName
  3467.         );
  3468.  
  3469.     [
  3470.     usesgetlasterror,
  3471.     #ifdef UNICODE
  3472.     entry("OpenMutexW"),
  3473.     #else
  3474.     entry("OpenMutexA"),
  3475.     #endif
  3476.     helpstring(""),
  3477.     ]
  3478.     HANDLE WINAPI OpenMutex(
  3479.         DWORD  dwDesiredAccess,
  3480.         BOOL bInheritHandle,
  3481.         LPCTSTR lpName
  3482.         );
  3483.  
  3484.     [
  3485.     usesgetlasterror,
  3486.     #ifdef UNICODE
  3487.     entry("CreateEventW"),
  3488.     #else
  3489.     entry("CreateEventA"),
  3490.     #endif
  3491.     helpstring(""),
  3492.     ]
  3493.     HANDLE WINAPI CreateEvent(
  3494.         DWORD /* SECURITY_ATTRIBUTES */ lpEventAttributes,
  3495.         BOOL bManualReset,
  3496.         BOOL bInitialState,
  3497.         LPCTSTR lpName
  3498.         );
  3499.  
  3500.     [
  3501.     usesgetlasterror,
  3502.     #ifdef UNICODE
  3503.     entry("CreateEventW"),
  3504.     #else
  3505.     entry("CreateEventA"),
  3506.     #endif
  3507.     helpstring(""),
  3508.     ]
  3509.     HANDLE WINAPI CreateEventSec(
  3510.         SECURITY_ATTRIBUTES * lpEventAttributes,
  3511.         BOOL bManualReset,
  3512.         BOOL bInitialState,
  3513.         LPCTSTR lpName
  3514.         );
  3515.  
  3516.     [
  3517.     usesgetlasterror,
  3518.     #ifdef UNICODE
  3519.     entry("OpenEventW"),
  3520.     #else
  3521.     entry("OpenEventA"),
  3522.     #endif
  3523.     helpstring(""),
  3524.     ]
  3525.     HANDLE WINAPI OpenEvent(
  3526.         DWORD  dwDesiredAccess,
  3527.         BOOL bInheritHandle,
  3528.         LPCTSTR lpName
  3529.         );
  3530.  
  3531.     [
  3532.     usesgetlasterror,
  3533.     #ifdef UNICODE
  3534.     entry("CreateSemaphoreW"),
  3535.     #else
  3536.     entry("CreateSemaphoreA"),
  3537.     #endif
  3538.     helpstring(""),
  3539.     ]
  3540.     HANDLE WINAPI CreateSemaphore(
  3541.         DWORD /* SECURITY_ATTRIBUTES */ lpSemaphoreAttributes,
  3542.         LONG lInitialCount,
  3543.         LONG lMaximumCount,
  3544.         LPCTSTR lpName
  3545.         );
  3546.  
  3547.     [
  3548.     usesgetlasterror,
  3549.     #ifdef UNICODE
  3550.     entry("CreateSemaphoreW"),
  3551.     #else
  3552.     entry("CreateSemaphoreA"),
  3553.     #endif
  3554.     helpstring(""),
  3555.     ]
  3556.     HANDLE WINAPI CreateSemaphoreSec(
  3557.         SECURITY_ATTRIBUTES * lpSemaphoreAttributes,
  3558.         LONG lInitialCount,
  3559.         LONG lMaximumCount,
  3560.         LPCTSTR lpName
  3561.         );
  3562.  
  3563.     [
  3564.     usesgetlasterror,
  3565.     #ifdef UNICODE
  3566.     entry("OpenSemaphoreW"),
  3567.     #else
  3568.     entry("OpenSemaphoreA"),
  3569.     #endif
  3570.     helpstring(""),
  3571.     ]
  3572.     HANDLE WINAPI OpenSemaphore(
  3573.         DWORD  dwDesiredAccess,
  3574.         BOOL bInheritHandle,
  3575.         LPCTSTR lpName
  3576.         );
  3577.  
  3578.     [
  3579.     usesgetlasterror,
  3580.     #ifdef UNICODE
  3581.     entry("CreateFileMappingW"),
  3582.     #else
  3583.     entry("CreateFileMappingA"),
  3584.     #endif
  3585.     helpstring("Maps file to memory or creates shared memory (if hFile is -1), assigns lpName to mapping, and returns mapping handle"),
  3586.     ]
  3587.     HANDLE WINAPI CreateFileMapping(
  3588.         HANDLE hFile,
  3589.         DWORD lpFileMappingAttributes,
  3590.         DWORD flProtect,
  3591.         DWORD dwMaximumSizeHigh,
  3592.         DWORD dwMaximumSizeLow,
  3593.         LPCTSTR lpName
  3594.         );
  3595.  
  3596.     [
  3597.     usesgetlasterror,
  3598.     #ifdef UNICODE
  3599.     entry("OpenFileMappingW"),
  3600.     #else
  3601.     entry("OpenFileMappingA"),
  3602.     #endif
  3603.     helpstring("Opens existing mapping specified by lpName"),
  3604.     ]
  3605.     HANDLE WINAPI OpenFileMapping(
  3606.         DWORD dwDesiredAccess,
  3607.         BOOL bInheritHandle,
  3608.         LPCTSTR lpName
  3609.         );
  3610.  
  3611.     [
  3612.     usesgetlasterror,
  3613.     #ifdef UNICODE
  3614.     entry("GetLogicalDriveStringsW"),
  3615.     #else
  3616.     entry("GetLogicalDriveStringsA"),
  3617.     #endif
  3618.     helpstring("Returns root path strings (with terminating double null) for all valid drives in lpBuffer"),
  3619.     ]
  3620.     DWORD WINAPI GetLogicalDriveStrings(DWORD nBufferLength,
  3621.                                         LPTSTR lpBuffer);
  3622.  
  3623.  
  3624.     // ****** Module Management *******
  3625.  
  3626.     [
  3627.     usesgetlasterror,
  3628.     #ifdef UNICODE
  3629.     entry("LoadLibraryW"),
  3630.     #else
  3631.     entry("LoadLibraryA"),
  3632.     #endif
  3633.     helpstring("Maps the specified executable module into the address space of the calling process"),
  3634.     ]
  3635.     HINSTANCE WINAPI LoadLibrary(LPCTSTR lpszLibFileName);
  3636.  
  3637.     [
  3638.     usesgetlasterror,
  3639.     #ifdef UNICODE
  3640.     entry("LoadLibraryExW"),
  3641.     #else
  3642.     entry("LoadLibraryExA"),
  3643.     #endif
  3644.     helpstring("Maps a specified executable module into the address space of the calling process"),
  3645.     ]
  3646.     HINSTANCE WINAPI LoadLibraryEx(LPCTSTR lpLibFileName,
  3647.                                    HANDLE hFile,
  3648.                                    DWORD dwFlags);
  3649.  
  3650.  
  3651.     /* Not implemented
  3652.     void WINAPI FreeLibraryAndExitThread(
  3653.         HMODULE hLibModule,
  3654.         DWORD dwExitCode
  3655.         );
  3656.  
  3657.     BOOL WINAPI DisableThreadLibraryCalls(
  3658.         HMODULE hLibModule
  3659.         );
  3660.     */
  3661.  
  3662.     [
  3663.     usesgetlasterror,
  3664.     #ifdef UNICODE
  3665.     entry("GetModuleFileNameW"),
  3666.     #else
  3667.     entry("GetModuleFileNameA"),
  3668.     #endif
  3669.     helpstring("Get full path name of a module from its handle"),
  3670.     ]
  3671.     int WINAPI GetModuleFileName(
  3672.         HINSTANCE hInst,
  3673.         LPTSTR lpszFileName,
  3674.         int cbFileName);
  3675.  
  3676.     [
  3677.     usesgetlasterror,
  3678.     #ifdef UNICODE
  3679.     entry("GetModuleHandleW"),
  3680.     #else
  3681.     entry("GetModuleHandleA"),
  3682.     #endif
  3683.     helpstring("Get the handle of a module from its name"),
  3684.     ]
  3685.     HMODULE WINAPI GetModuleHandle(LPCTSTR lpszModuleName);
  3686.  
  3687.     [
  3688.     usesgetlasterror,
  3689.     #ifdef UNICODE
  3690.     entry("CreateProcessW"),
  3691.     #else
  3692.     entry("CreateProcessA"),
  3693.     #endif
  3694.     helpstring("Creates a new process and executes a specified executable file"),
  3695.     ]
  3696.     BOOL WINAPI CreateProcess(LPCTSTR lpApplicationName,
  3697.                               LPTSTR lpCommandLine,
  3698.                               LPSECURITY_ATTRIBUTES lpProcessAttributes,
  3699.                               LPSECURITY_ATTRIBUTES lpThreadAttributes,
  3700.                               BOOL bInheritHandles,
  3701.                               DWORD dwCreationFlags,
  3702.                               LONG /* LPVOID */ lpEnvironment,
  3703.                               LPCTSTR lpCurrentDirectory,
  3704.                               STARTUPINFO * lpStartupInfo,
  3705.                               PROCESS_INFORMATION * lpProcessInformation);
  3706.  
  3707.     /*
  3708.     BOOL WINAPI SetProcessShutdownParameters(DWORD dwLevel, DWORD dwFlags);
  3709.     BOOL WINAPI GetProcessShutdownParameters(LPDWORD lpdwLevel, LPDWORD lpdwFlags);
  3710.     DWORD WINAPI GetProcessVersion(DWORD ProcessId);
  3711.     */
  3712.  
  3713.     [
  3714.     usesgetlasterror,
  3715.     entry("FatalAppExit"),
  3716.     helpstring("Displays a message box allowing the user to terminates the application or start the app under the kernel debugger"),
  3717.     ]
  3718.     void WINAPI FatalAppExit(UINT uAction, 
  3719.                              LPCTSTR lpMessageText);
  3720.  
  3721.     [
  3722.     usesgetlasterror,
  3723.     #ifdef UNICODE
  3724.     entry("GetStartupInfoW"),
  3725.     #else
  3726.     entry("GetStartupInfoA"),
  3727.     #endif
  3728.     helpstring("Retrieves the contents of the STARTUPINFO structure that was specified when the calling process was created"),
  3729.     ]
  3730.     void WINAPI GetStartupInfo(STARTUPINFO * lpStartupInfo);
  3731.  
  3732.  
  3733.     /*
  3734.     LPTSTR WINAPI GetCommandLineA(void);
  3735.     */
  3736.  
  3737.     [
  3738.     usesgetlasterror,
  3739.     #ifdef UNICODE
  3740.     entry("GetEnvironmentVariableW"),
  3741.     #else
  3742.     entry("GetEnvironmentVariableA"),
  3743.     #endif
  3744.     helpstring("Returns contents of environment variable lpName in lpBuffer"),
  3745.     ]
  3746.     DWORD WINAPI GetEnvironmentVariable(LPCTSTR lpName, LPTSTR lpBuffer, DWORD nSize);
  3747.  
  3748.     [
  3749.     usesgetlasterror,
  3750.     #ifdef UNICODE
  3751.     entry("SetEnvironmentVariableW"),
  3752.     #else
  3753.     entry("SetEnvironmentVariableA"),
  3754.     #endif
  3755.     helpstring("Sets environment variable lpName to value lpValue (deletes variable if lpValue is Null)"),
  3756.     ]
  3757.     BOOL WINAPI SetEnvironmentVariable(LPCTSTR lpName, LPCTSTR lpValue);
  3758.  
  3759.     [
  3760.     usesgetlasterror,
  3761.     #ifdef UNICODE
  3762.     entry("ExpandEnvironmentStringsW"),
  3763.     #else
  3764.     entry("ExpandEnvironmentStringsA"),
  3765.     #endif
  3766.     helpstring(""),
  3767.     ]
  3768.     DWORD WINAPI ExpandEnvironmentStrings(LPCTSTR lpSrc, LPTSTR lpDst, DWORD nSize);
  3769.  
  3770.     [
  3771.     usesgetlasterror,
  3772.     #ifdef UNICODE
  3773.     entry("OutputDebugStringW"),
  3774.     #else
  3775.     entry("OutputDebugStringA"),
  3776.     #endif
  3777.     helpstring("Send string to the debugging terminal"),
  3778.     ]
  3779.     void    WINAPI OutputDebugString(LPCTSTR lpszOutputString);
  3780.  
  3781.     // ****** Resource Management *******
  3782.  
  3783.     [
  3784.     usesgetlasterror,
  3785.     #ifdef UNICODE
  3786.     entry("FindResourceW"),
  3787.     #else
  3788.     entry("FindResourceA"),
  3789.     #endif
  3790.     helpstring("Finds a resource by its name, type, and module; returns a resource handle"),
  3791.     ]
  3792.     HRSRC   WINAPI FindResourceStrStr(HINSTANCE hInst,
  3793.                                       LPCTSTR lpszName,
  3794.                                       LPCTSTR lpszType);
  3795.  
  3796.     [
  3797.     usesgetlasterror,
  3798.     #ifdef UNICODE
  3799.     entry("FindResourceW"),
  3800.     #else
  3801.     entry("FindResourceA"),
  3802.     #endif
  3803.     helpstring("Finds a resource by its name, type, and module; returns a resource handle"),
  3804.     ]
  3805.     HRSRC   WINAPI FindResourceIdStr(HINSTANCE hInst,
  3806.                                      DWORD dwName,
  3807.                                      LPCTSTR lpszType);
  3808.  
  3809.     [
  3810.     usesgetlasterror,
  3811.     #ifdef UNICODE
  3812.     entry("FindResourceW"),
  3813.     #else
  3814.     entry("FindResourceA"),
  3815.     #endif
  3816.     helpstring("Finds a resource by its name, type, and module; returns a resource handle"),
  3817.     ]
  3818.     HRSRC   WINAPI FindResourceStrId(HINSTANCE hInst,
  3819.                                      LPCTSTR lpszName,
  3820.                                      DWORD dwType);
  3821.  
  3822.     [
  3823.     usesgetlasterror,
  3824.     #ifdef UNICODE
  3825.     entry("FindResourceW"),
  3826.     #else
  3827.     entry("FindResourceA"),
  3828.     #endif
  3829.     helpstring("Finds a resource by its name, type, and module; returns a resource handle"),
  3830.     ]
  3831.     HRSRC   WINAPI FindResourceIdId(HINSTANCE hInst,
  3832.                                     DWORD dwName,
  3833.                                     DWORD dwType);
  3834.  
  3835.  
  3836.     [
  3837.     usesgetlasterror,
  3838.     #ifdef UNICODE
  3839.     entry("FindResourceExW"),
  3840.     #else
  3841.     entry("FindResourceExA"),
  3842.     #endif
  3843.     helpstring("Determines the location of the resource with the specified type, name, and language in the specified module"),
  3844.     ]
  3845.     HRSRC WINAPI FindResourceEx(HINSTANCE hModule,
  3846.                                 LPCTSTR lpType,         
  3847.                                 LPCTSTR lpName,         
  3848.                                 WORD wLanguage);
  3849.  
  3850.     [
  3851.     usesgetlasterror,
  3852.     #ifdef UNICODE
  3853.     entry("EnumResourceTypesW"),
  3854.     #else
  3855.     entry("EnumResourceTypesA"),
  3856.     #endif
  3857.     helpstring(""),
  3858.     ]
  3859.     BOOL WINAPI EnumResourceTypes(HINSTANCE hModule,
  3860.                                   ENUMRESTYPEPROC lpEnumFunc,
  3861.                                   LPARAM lParam);
  3862.  
  3863.     [
  3864.     usesgetlasterror,
  3865.     #ifdef UNICODE
  3866.     entry("EnumResourceNamesW"),
  3867.     #else
  3868.     entry("EnumResourceNamesA"),
  3869.     #endif
  3870.     helpstring("Searches a module for resources, passing each resource type it finds to a callback function"),
  3871.     ]
  3872.     BOOL WINAPI EnumResourceNamesStr(HINSTANCE hModule,
  3873.                                      LPCTSTR lpType,
  3874.                                      ENUMRESTYPEPROC lpEnumFunc,
  3875.                                      LPARAM lParam);
  3876.     [
  3877.     usesgetlasterror,
  3878.     #ifdef UNICODE
  3879.     entry("EnumResourceNamesW"),
  3880.     #else
  3881.     entry("EnumResourceNamesA"),
  3882.     #endif
  3883.     helpstring("Searches a module for resources, passing each resource type it finds to a callback function"),
  3884.     ]
  3885.     BOOL WINAPI EnumResourceNamesID(HINSTANCE hModule,
  3886.                                     LONG lpType,
  3887.                                     ENUMRESTYPEPROC lpEnumFunc,
  3888.                                     LPARAM lParam);
  3889.  
  3890.     [
  3891.     usesgetlasterror,
  3892.     #ifdef UNICODE
  3893.     entry("EnumResourceLanguagesW"),
  3894.     #else
  3895.     entry("EnumResourceLanguagesA"),
  3896.     #endif
  3897.     helpstring("searches a module resources of a specified type and name, passing the language of each resource it locates to a callback function"),
  3898.     ]
  3899.     BOOL WINAPI EnumResourceLanguages(HINSTANCE hModule,
  3900.                                       LPCTSTR lpType,
  3901.                                       LPCTSTR lpName,
  3902.                                       ENUMRESTYPEPROC lpEnumFunc,
  3903.                                       LPARAM lParam);
  3904.  
  3905.     [
  3906.     usesgetlasterror,
  3907.     #ifdef UNICODE
  3908.     entry("BeginUpdateResourceW"),
  3909.     #else
  3910.     entry("BeginUpdateResourceA"),
  3911.     #endif
  3912.     helpstring("Returns a handle that can be used by the UpdateResource function to add, delete, or replace resources in an executable file"),
  3913.     ]
  3914.     HANDLE WINAPI BeginUpdateResource(LPCTSTR pFileName,
  3915.                                       BOOL bDeleteExistingResources);
  3916.  
  3917.     [
  3918.     usesgetlasterror,
  3919.     #ifdef UNICODE
  3920.     entry("UpdateResourceW"),
  3921.     #else
  3922.     entry("UpdateResourceA"),
  3923.     #endif
  3924.     helpstring("Adds, deletes, or replaces a resource in an executable file"),
  3925.     ]
  3926.     BOOL WINAPI UpdateResource(HANDLE hUpdate,
  3927.                                LPCTSTR lpType,
  3928.                                LPCTSTR lpName,
  3929.                                WORD wLanguage,
  3930.                                DWORD /* LPVOID */ lpData,
  3931.                                DWORD cbData);
  3932.  
  3933.     [
  3934.     usesgetlasterror,
  3935.     #ifdef UNICODE
  3936.     entry("EndUpdateResourceW"),
  3937.     #else
  3938.     entry("EndUpdateResourceA"),
  3939.     #endif
  3940.     helpstring("Ends a resource update in an executable file"),
  3941.     ]
  3942.     BOOL WINAPI EndUpdateResource(HANDLE hUpdate, 
  3943.                                   BOOL fDiscard);
  3944.  
  3945.     // ****** Atom Management *******
  3946.  
  3947.     /*
  3948.     ATOM    WINAPI GlobalAddAtom(LPCTSTR);
  3949.     ATOM    WINAPI GlobalFindAtom(LPCTSTR);
  3950.     UINT    WINAPI GlobalGetAtomName(ATOM, LPTSTR, int);
  3951.     ATOM    WINAPI AddAtom(LPCTSTR);
  3952.     ATOM    WINAPI FindAtom(LPCTSTR);
  3953.     UINT    WINAPI GetAtomName(ATOM, LPTSTR, int);
  3954.     */
  3955.  
  3956.     // ****** WIN.INI Support ******
  3957.  
  3958.     [
  3959.     usesgetlasterror,
  3960.     #ifdef UNICODE
  3961.     entry("GetProfileIntW"),
  3962.     #else
  3963.     entry("GetProfileIntA"),
  3964.     #endif
  3965.     helpstring("Gets an integer value from given entry within given section of WIN.INI (or default if not found)"),
  3966.     ]
  3967.     UINT    WINAPI GetProfileInt(LPCTSTR lpszSection,
  3968.                                  LPCTSTR lpszEntry,
  3969.                                  int iDef);
  3970.  
  3971.     [
  3972.     usesgetlasterror,
  3973.     #ifdef UNICODE
  3974.     entry("GetProfileStringW"),
  3975.     #else
  3976.     entry("GetProfileStringA"),
  3977.     #endif
  3978.     helpstring("Gets a string value from given entry within given section of WIN.INI (or default if not found)"),
  3979.     ]
  3980.     int     WINAPI GetProfileString(LPCTSTR lpszSection,
  3981.                                     LPCTSTR lpszEntry,
  3982.                                     LPCTSTR lpszDefault,
  3983.                                     LPTSTR lpszReturnBuffer,
  3984.                                     int cbReturnBuffer);
  3985.  
  3986.     [
  3987.     usesgetlasterror,
  3988.     #ifdef UNICODE
  3989.     entry("WriteProfileStringW"),
  3990.     #else
  3991.     entry("WriteProfileStringA"),
  3992.     #endif
  3993.     helpstring("Writes given string value to given entry within given section of WIN.INI"),
  3994.     ]
  3995.     BOOL    WINAPI WriteProfileString(LPCTSTR lpszSection,
  3996.                                       LPCTSTR lpszEntry,
  3997.                                       LPCTSTR lpszString);
  3998.  
  3999.     /*
  4000.     DWORD
  4001.     WINAPI
  4002.     GetProfileSectionA(
  4003.         LPCTSTR lpAppName,
  4004.         LPTSTR lpReturnedString,
  4005.         DWORD nSize
  4006.         );
  4007.  
  4008.     BOOL
  4009.     WINAPI
  4010.     WriteProfileSectionA(
  4011.         LPCTSTR lpAppName,
  4012.         LPCTSTR lpString
  4013.         );
  4014.     */
  4015.  
  4016.     [
  4017.     usesgetlasterror,
  4018.     #ifdef UNICODE
  4019.     entry("GetPrivateProfileIntW"),
  4020.     #else
  4021.     entry("GetPrivateProfileIntA"),
  4022.     #endif
  4023.     helpstring("Gets an integer value from given entry within given section of INI file (or default if not found)"),
  4024.     ]
  4025.     UINT    WINAPI GetPrivateProfileInt(LPCTSTR lpszSection,
  4026.                                         LPCTSTR lpszEntry,
  4027.                                         int iDef,
  4028.                                         LPCTSTR lpszFilename);
  4029.  
  4030.     [
  4031.     usesgetlasterror,
  4032.     #ifdef UNICODE
  4033.     entry("GetPrivateProfileStringW"),
  4034.     #else
  4035.     entry("GetPrivateProfileStringA"),
  4036.     #endif
  4037.     helpstring("Gets a string value from given entry within given section of INI file (or default if not found)"),
  4038.     ]
  4039.     int     WINAPI GetPrivateProfileString(LPCTSTR lpszSection,
  4040.                                            LPCTSTR lpszEntry,
  4041.                                            LPCTSTR lpszDefault,
  4042.                                            LPTSTR lpszReturnBuffer,
  4043.                                            int cbReturnBuffer,
  4044.                                            LPCTSTR lpszFilename);
  4045.  
  4046.     [
  4047.     usesgetlasterror,
  4048.     #ifdef UNICODE
  4049.     entry("WritePrivateProfileStringW"),
  4050.     #else
  4051.     entry("WritePrivateProfileStringA"),
  4052.     #endif
  4053.     helpstring("Writes given string value to given entry within given section of INI file"),
  4054.     ]
  4055.     BOOL    WINAPI WritePrivateProfileString(LPCTSTR lpszSection,
  4056.                                              LPCTSTR lpszEntry,
  4057.                                              LPCTSTR lpszString,
  4058.                                              LPCTSTR lpszFilename);
  4059.  
  4060.     /*
  4061.     DWORD
  4062.     WINAPI
  4063.     GetPrivateProfileSectionA(
  4064.         LPCTSTR lpAppName,
  4065.         LPTSTR lpReturnedString,
  4066.         DWORD nSize,
  4067.         LPCTSTR lpFileName
  4068.         );
  4069.  
  4070.     BOOL
  4071.     WINAPI
  4072.     WritePrivateProfileSectionA(
  4073.         LPCTSTR lpAppName,
  4074.         LPCTSTR lpString,
  4075.         LPCTSTR lpFileName
  4076.         );
  4077.  
  4078.     DWORD
  4079.     WINAPI
  4080.     GetPrivateProfileSectionNamesA(
  4081.         LPTSTR lpszReturnBuffer,
  4082.         DWORD nSize,
  4083.         LPCTSTR lpFileName
  4084.         );
  4085.  
  4086.     BOOL
  4087.     WINAPI
  4088.     GetPrivateProfileStructA(
  4089.         LPCTSTR lpszSection,
  4090.         LPCTSTR lpszKey,
  4091.         LPVOID   lpStruct,
  4092.         UINT     uSizeStruct,
  4093.         LPCTSTR szFile
  4094.         );
  4095.  
  4096.     BOOL
  4097.     WINAPI
  4098.     WritePrivateProfileStructA(
  4099.         LPCTSTR lpszSection,
  4100.         LPCTSTR lpszKey,
  4101.         LPVOID   lpStruct,
  4102.         UINT     uSizeStruct,
  4103.         LPCTSTR szFile
  4104.         );
  4105.     */
  4106.  
  4107.     [
  4108.     usesgetlasterror,
  4109.     #ifdef UNICODE
  4110.     entry("GetDriveTypeW"),
  4111.     #else
  4112.     entry("GetDriveTypeA"),
  4113.     #endif
  4114.     helpstring("Returns the type of disk lpRootPathName"),
  4115.     ]
  4116.     UINT WINAPI GetDriveType([in]LPCTSTR lpRootPathName);
  4117.  
  4118.     [
  4119.     usesgetlasterror,
  4120.     #ifdef UNICODE
  4121.     entry("GetSystemDirectoryW"),
  4122.     #else
  4123.     entry("GetSystemDirectoryA"),
  4124.     #endif
  4125.     helpstring("Gets Windows System directory"),
  4126.     ]
  4127.     UINT WINAPI GetSystemDirectory(LPTSTR lpszSysPath,
  4128.                                    UINT cbSysPath);
  4129.  
  4130.     [
  4131.     usesgetlasterror,
  4132.     #ifdef UNICODE
  4133.     entry("GetTempPathW"),
  4134.     #else
  4135.     entry("GetTempPathA"),
  4136.     #endif
  4137.     helpstring("Returns the directory for temporary files in lpBuffer"),
  4138.     ]
  4139.     DWORD WINAPI GetTempPath(DWORD nBufferLength,
  4140.                              LPTSTR lpBuffer);
  4141.  
  4142.     [
  4143.     usesgetlasterror,
  4144.     #ifdef UNICODE
  4145.     entry("GetTempFileNameW"),
  4146.     #else
  4147.     entry("GetTempFileNameA"),
  4148.     #endif
  4149.     helpstring("Returns name of a unique file with lpPrefixString for directory lpPathName in lpTempfileName"),
  4150.     ]
  4151.     UINT WINAPI GetTempFileName(LPCTSTR lpPathName,
  4152.                                 LPCTSTR lpPrefixString,
  4153.                                 UINT uUnique,
  4154.                                 LPTSTR lpTempFileName);
  4155.  
  4156. //@B GetWindowsDirectory
  4157.     [
  4158.     usesgetlasterror,
  4159.     #ifdef UNICODE
  4160.     entry("GetWindowsDirectoryW"),
  4161.     #else
  4162.     entry("GetWindowsDirectoryA"),
  4163.     #endif
  4164.     helpstring("Gets Windows directory"),
  4165.     ]
  4166.     UINT WINAPI GetWindowsDirectory(LPTSTR lpszSysPath,
  4167.                                     UINT cbSysPath);
  4168. //@E GetWindowsDirectory
  4169.  
  4170.     [
  4171.     usesgetlasterror,
  4172.     #ifdef UNICODE
  4173.     entry("SetCurrentDirectoryW"),
  4174.     #else
  4175.     entry("SetCurrentDirectoryA"),
  4176.     #endif
  4177.     helpstring(""),
  4178.     ]
  4179.     BOOL WINAPI SetCurrentDirectory(LPCTSTR lpPathName);
  4180.  
  4181.     [
  4182.     usesgetlasterror,
  4183.     #ifdef UNICODE
  4184.     entry("GetCurrentDirectoryW"),
  4185.     #else
  4186.     entry("GetCurrentDirectoryA"),
  4187.     #endif
  4188.     helpstring(""),
  4189.     ]
  4190.     DWORD WINAPI GetCurrentDirectory(DWORD  nBufferLength, LPTSTR lpBuffer);
  4191.  
  4192.     [
  4193.     usesgetlasterror,
  4194.     #ifdef UNICODE
  4195.     entry("GetDiskFreeSpaceW"),
  4196.     #else
  4197.     entry("GetDiskFreeSpaceA"),
  4198.     #endif
  4199.     helpstring("Returns information about disk lpRootPathName in lpSectorsPerCluster, lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters"),
  4200.     ]
  4201.     BOOL WINAPI GetDiskFreeSpace(LPCTSTR lpRootPathName,
  4202.                                  DWORD *lpSectorsPerCluster,
  4203.                                  DWORD *lpBytesPerSector,
  4204.                                  DWORD *lpNumberOfFreeClusters,
  4205.                                  DWORD *lpTotalNumberOfClusters);
  4206.  
  4207.     [
  4208.     usesgetlasterror,
  4209.     #ifdef UNICODE
  4210.     entry("CreateDirectoryW"),
  4211.     #else
  4212.     entry("CreateDirectoryA"),
  4213.     #endif
  4214.     helpstring(""),
  4215.     ]
  4216.     BOOL WINAPI CreateDirectory(
  4217.         LPCTSTR lpPathName,
  4218.         DWORD /* SECURITY_ATTRIBUTES */ lpSecurityAttributes
  4219.         );
  4220.  
  4221.     [
  4222.     usesgetlasterror,
  4223.     #ifdef UNICODE
  4224.     entry("CreateDirectoryW"),
  4225.     #else
  4226.     entry("CreateDirectoryA"),
  4227.     #endif
  4228.     helpstring(""),
  4229.     ]
  4230.     BOOL WINAPI CreateDirectorySec(
  4231.         LPCTSTR lpPathName,
  4232.         SECURITY_ATTRIBUTES * lpSecurityAttributes
  4233.         );
  4234.  
  4235.     [
  4236.     usesgetlasterror,
  4237.     #ifdef UNICODE
  4238.     entry("CreateDirectoryExW"),
  4239.     #else
  4240.     entry("CreateDirectoryExA"),
  4241.     #endif
  4242.     helpstring(""),
  4243.     ]
  4244.     BOOL WINAPI CreateDirectoryEx(
  4245.         LPCTSTR lpTemplateDirectory,
  4246.         LPCTSTR lpNewDirectory,
  4247.         DWORD /* SECURITY_ATTRIBUTES */ lpSecurityAttributes
  4248.         );
  4249.  
  4250.     [
  4251.     usesgetlasterror,
  4252.     #ifdef UNICODE
  4253.     entry("CreateDirectoryExW"),
  4254.     #else
  4255.     entry("CreateDirectoryExA"),
  4256.     #endif
  4257.     helpstring(""),
  4258.     ]
  4259.     BOOL WINAPI CreateDirectoryExSec(
  4260.         LPCTSTR lpTemplateDirectory,
  4261.         LPCTSTR lpNewDirectory,
  4262.         SECURITY_ATTRIBUTES * lpSecurityAttributes
  4263.         );
  4264.  
  4265.     [
  4266.     usesgetlasterror,
  4267.     #ifdef UNICODE
  4268.     entry("RemoveDirectoryW"),
  4269.     #else
  4270.     entry("RemoveDirectoryA"),
  4271.     #endif
  4272.     helpstring(""),
  4273.     ]
  4274.     BOOL WINAPI RemoveDirectory(
  4275.         LPCTSTR lpPathName
  4276.         );
  4277.  
  4278.     [
  4279.     usesgetlasterror,
  4280.     #ifdef UNICODE
  4281.     entry("GetFullPathNameW"),
  4282.     #else
  4283.     entry("GetFullPathNameA"),
  4284.     #endif
  4285.     helpstring("Returns full path of lpFileName in lpBuffer and lpFilePart"),
  4286.     ]
  4287.     DWORD WINAPI GetFullPathName(LPCTSTR lpFileName,
  4288.                                  DWORD nBufferLength,
  4289.                                  LPTSTR lpBuffer,
  4290.                                  DWORD *lpFilePart);
  4291.  
  4292.     /* Some directory not implemented
  4293.  
  4294.     BOOL WINAPI DefineDosDeviceA(
  4295.         DWORD  dwFlags,
  4296.         LPCTSTR lpDeviceName,
  4297.         LPCTSTR lpTargetPath
  4298.         );
  4299.  
  4300.     DWORD WINAPI QueryDosDeviceA(
  4301.         LPCTSTR lpDeviceName,
  4302.         LPTSTR lpTargetPath,
  4303.         DWORD  ucchMax
  4304.         );
  4305.  
  4306.     */
  4307.  
  4308.     // ****** File I/O **********
  4309.  
  4310.     [
  4311.     usesgetlasterror,
  4312.     #ifdef UNICODE
  4313.     entry("CreateFileW"),
  4314.     #else
  4315.     entry("CreateFileA"),
  4316.     #endif
  4317.     helpstring("Creates or opens a file, pipe, communications resource, disk device, console, or directory"),
  4318.     ]
  4319.     HANDLE WINAPI CreateFile(LPCTSTR lpFileName,
  4320.                              DWORD dwDesiredAccess,
  4321.                              DWORD dwShareMode,
  4322.                              LONG lpSecurityAttributes,
  4323.                              DWORD dwCreationDisposition,
  4324.                              DWORD dwFlagsAndAttributes,
  4325.                              HANDLE hTemplateFile);
  4326.  
  4327.     [
  4328.     usesgetlasterror,
  4329.     #ifdef UNICODE
  4330.     entry("SetFileAttributesW"),
  4331.     #else
  4332.     entry("SetFileAttributesA"),
  4333.     #endif
  4334.     helpstring("Sets file attribute bitflags"),
  4335.     ]
  4336.     BOOL WINAPI SetFileAttributes(LPCTSTR lpFileName,
  4337.                                   DWORD dwFileAttributes);
  4338.  
  4339.     [
  4340.     usesgetlasterror,
  4341.     #ifdef UNICODE
  4342.     entry("GetFileAttributesW"),
  4343.     #else
  4344.     entry("GetFileAttributesA"),
  4345.     #endif
  4346.     helpstring("Gets file attribute bitflags"),
  4347.     ]
  4348.     DWORD WINAPI GetFileAttributes(LPCTSTR lpFileName);
  4349.  
  4350.     [
  4351.     usesgetlasterror,
  4352.     #ifdef UNICODE
  4353.     entry("GetCompressedFileSizeW"),
  4354.     #else
  4355.     entry("GetCompressedFileSizeA"),
  4356.     #endif
  4357.     helpstring("Obtains the compressed size, in bytes, of a specified file"),
  4358.     ]
  4359.     DWORD WINAPI GetCompressedFileSize(LPCTSTR lpFileName,
  4360.                                        DWORD * lpFileSizeHigh);
  4361.  
  4362.     [
  4363.     usesgetlasterror,
  4364.     #ifdef UNICODE
  4365.     entry("DeleteFileW"),
  4366.     #else
  4367.     entry("DeleteFileA"),
  4368.     #endif
  4369.     helpstring("Deletes an existing file"),
  4370.     ]
  4371.     BOOL WINAPI DeleteFile(LPCTSTR lpFileName);
  4372.  
  4373.     [
  4374.     usesgetlasterror,
  4375.     #ifdef UNICODE
  4376.     entry("FindFirstFileW"),
  4377.     #else
  4378.     entry("FindFirstFileA"),
  4379.     #endif
  4380.     helpstring("Searches directory for first file matching a given wild-card specification"),
  4381.     ]
  4382.     HANDLE WINAPI FindFirstFile(LPCTSTR lpFileName,
  4383.                                 LPVOID lpFindFileData);
  4384.  
  4385.     [
  4386.     usesgetlasterror,
  4387.     #ifdef UNICODE
  4388.     entry("FindNextFileW"),
  4389.     #else
  4390.     entry("FindNextFileA"),
  4391.     #endif
  4392.     helpstring("Gets next matching file in a search started by FindFirstFile"),
  4393.     ]
  4394.     BOOL WINAPI FindNextFile(HANDLE hFindFile,
  4395.                              LPVOID lpFindFileData);
  4396.  
  4397.     [
  4398.     usesgetlasterror,
  4399.     #ifdef UNICODE
  4400.     entry("SearchPathW"),
  4401.     #else
  4402.     entry("SearchPathA"),
  4403.     #endif
  4404.     helpstring("Searches lpPath for lpFileName with lpfExtension and returns full path result in lpBuffer and lpFilePart"),
  4405.     ]
  4406.     DWORD WINAPI SearchPath(LPCTSTR lpPath, LPCTSTR lpFileName,
  4407.                             LPCTSTR lpExtension,
  4408.                             DWORD nBufferLength,
  4409.                             LPTSTR lpBuffer,
  4410.                             DWORD *lpFilePart);
  4411.  
  4412.     [
  4413.     usesgetlasterror,
  4414.     #ifdef UNICODE
  4415.     entry("CopyFileW"),
  4416.     #else
  4417.     entry("CopyFileA"),
  4418.     #endif
  4419.     helpstring("Copies an existing file to a new file"),
  4420.     ]
  4421.     BOOL WINAPI CopyFile(LPCTSTR lpExistingFileName,
  4422.                          LPCTSTR lpNewFileName, 
  4423.                          BOOL bFailIfExists);
  4424.  
  4425.     [
  4426.     usesgetlasterror,
  4427.     #ifdef UNICODE
  4428.     entry("MoveFileW"),
  4429.     #else
  4430.     entry("MoveFileA"),
  4431.     #endif
  4432.     helpstring("Renames an existing file or directory (including all its children)"),
  4433.     ]
  4434.     BOOL WINAPI MoveFile(LPCTSTR lpExistingFileName, 
  4435.                          LPCTSTR lpNewFileName);
  4436.  
  4437.     [
  4438.     usesgetlasterror,
  4439.     #ifdef UNICODE
  4440.     entry("MoveFileExW"),
  4441.     #else
  4442.     entry("MoveFileExA"),
  4443.     #endif
  4444.     helpstring("Renames an existing file or directory"),
  4445.     ]
  4446.     BOOL WINAPI MoveFileEx(LPCTSTR lpExistingFileName,
  4447.                            LPCTSTR lpNewFileName, 
  4448.                            DWORD dwFlags);
  4449.  
  4450.  
  4451.     [
  4452.     usesgetlasterror,
  4453.     #ifdef UNICODE
  4454.     entry("CreateNamedPipeW"),
  4455.     #else
  4456.     entry("CreateNamedPipeA"),
  4457.     #endif
  4458.     helpstring("Creates an instance of a named pipe and returns a handle for subsequent pipe operations (null security)"),
  4459.     ]
  4460.     HANDLE WINAPI CreateNamedPipe(LPCTSTR lpName,
  4461.                                   DWORD  dwOpenMode,
  4462.                                   DWORD  dwPipeMode,
  4463.                                   DWORD  nMaxInstances,
  4464.                                   DWORD  nOutBufferSize,
  4465.                                   DWORD  nInBufferSize,
  4466.                                   DWORD  nDefaultTimeOut,
  4467.                                   LPSECURITY_ATTRIBUTES lpSecurityAttributes);
  4468.  
  4469.     [
  4470.     usesgetlasterror,
  4471.     #ifdef UNICODE
  4472.     entry("GetNamedPipeHandleStateW"),
  4473.     #else
  4474.     entry("GetNamedPipeHandleStateA"),
  4475.     #endif
  4476.     helpstring("Retrieves information about a specified named pipe"),
  4477.     ]
  4478.     BOOL WINAPI GetNamedPipeHandleState(HANDLE hNamedPipe,
  4479.                                         DWORD * lpState,
  4480.                                         DWORD * lpCurInstances,
  4481.                                         DWORD * lpMaxCollectionCount,
  4482.                                         DWORD * lpCollectDataTimeout,
  4483.                                         LPTSTR lpUserName,
  4484.                                         DWORD nMaxUserNameSize);
  4485.  
  4486.     [
  4487.     usesgetlasterror,
  4488.     #ifdef UNICODE
  4489.     entry("CallNamedPipeW"),
  4490.     #else
  4491.     entry("CallNamedPipeA"),
  4492.     #endif
  4493.     helpstring("Connects to a message-type pipe (waiting if an instance of the pipe is not available), writes to and reads from the pipe, and then closes the pipe"),
  4494.     ]
  4495.     BOOL WINAPI CallNamedPipe(LPCTSTR lpNamedPipeName,
  4496.                               LPVOID lpInBuffer,
  4497.                               DWORD nInBufferSize,
  4498.                               LPVOID lpOutBuffer,
  4499.                               DWORD nOutBufferSize,
  4500.                               DWORD * lpBytesRead,
  4501.                               DWORD nTimeOut);
  4502.  
  4503.     [
  4504.     usesgetlasterror,
  4505.     #ifdef UNICODE
  4506.     entry("WaitNamedPipeW"),
  4507.     #else
  4508.     entry("WaitNamedPipeA"),
  4509.     #endif
  4510.     helpstring("Waits until either a time-out interval elapses or an instance of the specified named pipe is available to be connected to"),
  4511.     ]
  4512.     BOOL WINAPI WaitNamedPipe(LPCTSTR lpNamedPipeName,
  4513.                               DWORD nTimeOut);
  4514.  
  4515.     [
  4516.     usesgetlasterror,
  4517.     #ifdef UNICODE
  4518.     entry("SetVolumeLabelW"),
  4519.     #else
  4520.     entry("SetVolumeLabelA"),
  4521.     #endif
  4522.     helpstring("Sets label of file system volume specified by root path"),
  4523.     ]
  4524.     BOOL WINAPI SetVolumeLabel(LPCTSTR lpRootPathName,
  4525.                                LPCTSTR lpVolumeName);
  4526.  
  4527.     /* Miscellaneous not implemented
  4528.     void WINAPI SetFileApisToOEM( void );
  4529.  
  4530.     void WINAPI SetFileApisToANSI( void );
  4531.  
  4532.     BOOL WINAPI AreFileApisANSI( void );
  4533.     */
  4534.  
  4535.     [
  4536.     usesgetlasterror,
  4537.     #ifdef UNICODE
  4538.     entry("GetVolumeInformationW"),
  4539.     #else
  4540.     entry("GetVolumeInformationA"),
  4541.     #endif
  4542.     helpstring("Gets information about a disk including volume name, serial number, maximum component length, and file system name"),
  4543.     ]
  4544.     BOOL WINAPI GetVolumeInformation(LPCTSTR lpRootPathName,
  4545.                                      LPTSTR lpVolumeNameBuffer,
  4546.                                      DWORD nVolumeNameSize,
  4547.                                      DWORD *lpVolumeSerialNumber,
  4548.                                      DWORD *lpMaximumComponentLength,
  4549.                                      DWORD *lpFileSystemFlags,
  4550.                                      LPTSTR lpFileSystemNameBuffer,
  4551.                                      DWORD nFileSystemNameSize);
  4552.  
  4553.     /* Event logging not implemented
  4554.     BOOL WINAPI ClearEventLogA (
  4555.         HANDLE hEventLog,
  4556.         LPCTSTR lpBackupFileName
  4557.         );
  4558.  
  4559.     BOOL WINAPI BackupEventLogA (
  4560.         HANDLE hEventLog,
  4561.         LPCTSTR lpBackupFileName
  4562.         );
  4563.  
  4564.     BOOL WINAPI CloseEventLog (
  4565.         HANDLE hEventLog
  4566.         );
  4567.  
  4568.     BOOL WINAPI DeregisterEventSource (
  4569.         HANDLE hEventLog
  4570.         );
  4571.  
  4572.     BOOL WINAPI NotifyChangeEventLog (
  4573.         HANDLE hEventLog,
  4574.         HANDLE hEvent
  4575.         );
  4576.  
  4577.     BOOL WINAPI GetNumberOfEventLogRecords (
  4578.         HANDLE hEventLog,
  4579.         PDWORD NumberOfRecords
  4580.         );
  4581.  
  4582.     BOOL WINAPI GetOldestEventLogRecord (
  4583.         HANDLE hEventLog,
  4584.         PDWORD OldestRecord
  4585.         );
  4586.  
  4587.     HANDLE WINAPI OpenEventLogA (
  4588.         LPCTSTR lpUNCServerName,
  4589.         LPCTSTR lpSourceName
  4590.         );
  4591.  
  4592.     HANDLE WINAPI RegisterEventSourceA (
  4593.         LPCTSTR lpUNCServerName,
  4594.         LPCTSTR lpSourceName
  4595.         );
  4596.  
  4597.     HANDLE WINAPI OpenBackupEventLogA (
  4598.         LPCTSTR lpUNCServerName,
  4599.         LPCTSTR lpFileName
  4600.         );
  4601.  
  4602.     BOOL WINAPI ReadEventLogA (
  4603.          HANDLE hEventLog,
  4604.          DWORD  dwReadFlags,
  4605.          DWORD  dwRecordOffset,
  4606.          LPVOID lpBuffer,
  4607.          DWORD nNumberOfBytesToRead,
  4608.          DWORD * pnBytesRead,
  4609.          DWORD * pnMinNumberOfBytesNeeded
  4610.         );
  4611.  
  4612.     BOOL WINAPI ReportEventA (
  4613.          HANDLE     hEventLog,
  4614.          WORD       wType,
  4615.          WORD       wCategory,
  4616.          DWORD       dwEventID,
  4617.          PSID       lpUserSid,
  4618.          WORD       wNumStrings,
  4619.          DWORD dwDataSize,
  4620.          LPCTSTR * lpStrings,
  4621.          LPVOID     lpRawData
  4622.         );
  4623.     */
  4624.  
  4625.     /* Security Not implemented
  4626.     BOOL WINAPI DuplicateToken(
  4627.         HANDLE ExistingTokenHandle,
  4628.         SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
  4629.         PHANDLE DuplicateTokenHandle
  4630.         );
  4631.  
  4632.     BOOL WINAPI GetKernelObjectSecurity (
  4633.         HANDLE Handle,
  4634.         SECURITY_INFORMATION RequestedInformation,
  4635.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  4636.         DWORD  nLength,
  4637.         DWORD * lpnLengthNeeded
  4638.         );
  4639.  
  4640.     BOOL WINAPI ImpersonateNamedPipeClient(
  4641.         HANDLE hNamedPipe
  4642.         );
  4643.  
  4644.     BOOL WINAPI ImpersonateSelf(
  4645.         SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
  4646.         );
  4647.  
  4648.  
  4649.     BOOL WINAPI RevertToSelf (
  4650.         void
  4651.         );
  4652.  
  4653.     BOOL WINAPI SetThreadToken (
  4654.         PHANDLE Thread,
  4655.         HANDLE Token
  4656.         );
  4657.  
  4658.     BOOL WINAPI AccessCheck (
  4659.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  4660.         HANDLE ClientToken,
  4661.         DWORD  DesiredAccess,
  4662.         PGENERIC_MAPPING GenericMapping,
  4663.         PPRIVILEGE_SET PrivilegeSet,
  4664.         DWORD * PrivilegeSetLength,
  4665.         DWORD * GrantedAccess,
  4666.         BOOL * AccessStatus
  4667.         );
  4668.  
  4669.  
  4670.     BOOL WINAPI OpenProcessToken (
  4671.         HANDLE ProcessHandle,
  4672.         DWORD  DesiredAccess,
  4673.         PHANDLE TokenHandle
  4674.         );
  4675.  
  4676.  
  4677.     BOOL WINAPI OpenThreadToken (
  4678.         HANDLE ThreadHandle,
  4679.         DWORD  DesiredAccess,
  4680.         BOOL OpenAsSelf,
  4681.         PHANDLE TokenHandle
  4682.         );
  4683.  
  4684.  
  4685.     BOOL WINAPI GetTokenInformation (
  4686.         HANDLE TokenHandle,
  4687.         TOKEN_INFORMATION_CLASS TokenInformationClass,
  4688.         LPVOID TokenInformation,
  4689.         DWORD  TokenInformationLength,
  4690.         PDWORD ReturnLength
  4691.         );
  4692.  
  4693.  
  4694.     BOOL WINAPI SetTokenInformation (
  4695.         HANDLE TokenHandle,
  4696.         TOKEN_INFORMATION_CLASS TokenInformationClass,
  4697.         LPVOID TokenInformation,
  4698.         DWORD  TokenInformationLength
  4699.         );
  4700.  
  4701.  
  4702.     BOOL WINAPI AdjustTokenPrivileges (
  4703.         HANDLE TokenHandle,
  4704.         BOOL DisableAllPrivileges,
  4705.         PTOKEN_PRIVILEGES NewState,
  4706.         DWORD  BufferLength,
  4707.         PTOKEN_PRIVILEGES PreviousState,
  4708.         PDWORD ReturnLength
  4709.         );
  4710.  
  4711.  
  4712.     BOOL WINAPI AdjustTokenGroups (
  4713.         HANDLE TokenHandle,
  4714.         BOOL ResetToDefault,
  4715.         PTOKEN_GROUPS NewState,
  4716.         DWORD  BufferLength,
  4717.         PTOKEN_GROUPS PreviousState,
  4718.         PDWORD ReturnLength
  4719.         );
  4720.  
  4721.  
  4722.     BOOL WINAPI PrivilegeCheck (
  4723.         HANDLE ClientToken,
  4724.         PPRIVILEGE_SET RequiredPrivileges,
  4725.         BOOL * pfResult
  4726.         );
  4727.  
  4728.  
  4729.     BOOL WINAPI AccessCheckAndAuditAlarmA (
  4730.         LPCTSTR SubsystemName,
  4731.         LPVOID HandleId,
  4732.         LPTSTR ObjectTypeName,
  4733.         LPTSTR ObjectName,
  4734.         PSECURITY_DESCRIPTOR SecurityDescriptor,
  4735.         DWORD  DesiredAccess,
  4736.         PGENERIC_MAPPING GenericMapping,
  4737.         BOOL ObjectCreation,
  4738.         DWORD * GrantedAccess,
  4739.         BOOL * AccessStatus,
  4740.         BOOL * pfGenerateOnClose
  4741.         );
  4742.  
  4743.     BOOL WINAPI ObjectOpenAuditAlarmA (
  4744.         LPCTSTR SubsystemName,
  4745.         LPVOID HandleId,
  4746.         LPTSTR ObjectTypeName,
  4747.         LPTSTR ObjectName,
  4748.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  4749.         HANDLE ClientToken,
  4750.         DWORD  DesiredAccess,
  4751.         DWORD  GrantedAccess,
  4752.         PPRIVILEGE_SET Privileges,
  4753.         BOOL ObjectCreation,
  4754.         BOOL AccessGranted,
  4755.         BOOL * GenerateOnClose
  4756.         );
  4757.  
  4758.     BOOL WINAPI ObjectPrivilegeAuditAlarmA (
  4759.         LPCTSTR SubsystemName,
  4760.         LPVOID HandleId,
  4761.         HANDLE ClientToken,
  4762.         DWORD  DesiredAccess,
  4763.         PPRIVILEGE_SET Privileges,
  4764.         BOOL AccessGranted
  4765.         );
  4766.  
  4767.     BOOL WINAPI ObjectCloseAuditAlarmA (
  4768.         LPCTSTR SubsystemName,
  4769.         LPVOID HandleId,
  4770.         BOOL GenerateOnClose
  4771.         );
  4772.  
  4773.     BOOL WINAPI PrivilegedServiceAuditAlarmA (
  4774.         LPCTSTR SubsystemName,
  4775.         LPCTSTR ServiceName,
  4776.         HANDLE ClientToken,
  4777.         PPRIVILEGE_SET Privileges,
  4778.         BOOL AccessGranted
  4779.         );
  4780.  
  4781.     BOOL WINAPI IsValidSid (
  4782.         PSID pSid
  4783.         );
  4784.  
  4785.  
  4786.     BOOL WINAPI EqualSid (
  4787.         PSID pSid1,
  4788.         PSID pSid2
  4789.         );
  4790.  
  4791.  
  4792.     BOOL WINAPI EqualPrefixSid (
  4793.         PSID pSid1,
  4794.         PSID pSid2
  4795.         );
  4796.  
  4797.  
  4798.     DWORD WINAPI GetSidLengthRequired (
  4799.         UCHAR nSubAuthorityCount
  4800.         );
  4801.  
  4802.  
  4803.     BOOL WINAPI AllocateAndInitializeSid (
  4804.         PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
  4805.         BYTE nSubAuthorityCount,
  4806.         DWORD  nSubAuthority0,
  4807.         DWORD  nSubAuthority1,
  4808.         DWORD  nSubAuthority2,
  4809.         DWORD  nSubAuthority3,
  4810.         DWORD  nSubAuthority4,
  4811.         DWORD  nSubAuthority5,
  4812.         DWORD  nSubAuthority6,
  4813.         DWORD  nSubAuthority7,
  4814.         PSID *pSid
  4815.         );
  4816.  
  4817.     Pvoid WINAPI FreeSid(
  4818.         PSID pSid
  4819.         );
  4820.  
  4821.     BOOL WINAPI InitializeSid (
  4822.         PSID Sid,
  4823.         PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
  4824.         BYTE nSubAuthorityCount
  4825.         );
  4826.  
  4827.  
  4828.     PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority (
  4829.         PSID pSid
  4830.         );
  4831.  
  4832.  
  4833.     PDWORD WINAPI GetSidSubAuthority (
  4834.         PSID pSid,
  4835.         DWORD  nSubAuthority
  4836.         );
  4837.  
  4838.  
  4839.     PUCHAR WINAPI GetSidSubAuthorityCount (
  4840.         PSID pSid
  4841.         );
  4842.  
  4843.  
  4844.     DWORD WINAPI GetLengthSid (
  4845.         PSID pSid
  4846.         );
  4847.  
  4848.  
  4849.     BOOL WINAPI CopySid (
  4850.         DWORD  nDestinationSidLength,
  4851.         PSID pDestinationSid,
  4852.         PSID pSourceSid
  4853.         );
  4854.  
  4855.  
  4856.     BOOL WINAPI AreAllAccessesGranted (
  4857.         DWORD  GrantedAccess,
  4858.         DWORD  DesiredAccess
  4859.         );
  4860.  
  4861.  
  4862.     BOOL WINAPI AreAnyAccessesGranted (
  4863.         DWORD  GrantedAccess,
  4864.         DWORD  DesiredAccess
  4865.         );
  4866.  
  4867.  
  4868.     void WINAPI MapGenericMask (
  4869.         PDWORD AccessMask,
  4870.         PGENERIC_MAPPING GenericMapping
  4871.         );
  4872.  
  4873.  
  4874.     BOOL WINAPI IsValidAcl (
  4875.         PACL pAcl
  4876.         );
  4877.  
  4878.  
  4879.     BOOL WINAPI InitializeAcl (
  4880.         PACL pAcl,
  4881.         DWORD  nAclLength,
  4882.         DWORD  dwAclRevision
  4883.         );
  4884.  
  4885.  
  4886.     BOOL WINAPI GetAclInformation (
  4887.         PACL pAcl,
  4888.         LPVOID pAclInformation,
  4889.         DWORD  nAclInformationLength,
  4890.         ACL_INFORMATION_CLASS dwAclInformationClass
  4891.         );
  4892.  
  4893.  
  4894.     BOOL WINAPI SetAclInformation (
  4895.         PACL pAcl,
  4896.         LPVOID pAclInformation,
  4897.         DWORD  nAclInformationLength,
  4898.         ACL_INFORMATION_CLASS dwAclInformationClass
  4899.         );
  4900.  
  4901.  
  4902.     BOOL WINAPI AddAce (
  4903.         PACL pAcl,
  4904.         DWORD  dwAceRevision,
  4905.         DWORD  dwStartingAceIndex,
  4906.         LPVOID pAceList,
  4907.         DWORD  nAceListLength
  4908.         );
  4909.  
  4910.  
  4911.     BOOL WINAPI DeleteAce (
  4912.         PACL pAcl,
  4913.         DWORD  dwAceIndex
  4914.         );
  4915.  
  4916.  
  4917.     BOOL WINAPI GetAce (
  4918.         PACL pAcl,
  4919.         DWORD  dwAceIndex,
  4920.         LPVOID *pAce
  4921.         );
  4922.  
  4923.  
  4924.     BOOL WINAPI AddAccessAllowedAce (
  4925.         PACL pAcl,
  4926.         DWORD  dwAceRevision,
  4927.         DWORD  AccessMask,
  4928.         PSID pSid
  4929.         );
  4930.  
  4931.  
  4932.     BOOL WINAPI AddAccessDeniedAce (
  4933.         PACL pAcl,
  4934.         DWORD  dwAceRevision,
  4935.         DWORD  AccessMask,
  4936.         PSID pSid
  4937.         );
  4938.  
  4939.  
  4940.     BOOL WINAPI AddAuditAccessAce(
  4941.         PACL pAcl,
  4942.         DWORD  dwAceRevision,
  4943.         DWORD  dwAccessMask,
  4944.         PSID pSid,
  4945.         BOOL bAuditSuccess,
  4946.         BOOL bAuditFailure
  4947.         );
  4948.  
  4949.  
  4950.     BOOL WINAPI FindFirstFreeAce (
  4951.         PACL pAcl,
  4952.         LPVOID *pAce
  4953.         );
  4954.  
  4955.  
  4956.     BOOL WINAPI InitializeSecurityDescriptor (
  4957.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  4958.         DWORD  dwRevision
  4959.         );
  4960.  
  4961.  
  4962.     BOOL WINAPI IsValidSecurityDescriptor (
  4963.         PSECURITY_DESCRIPTOR pSecurityDescriptor
  4964.         );
  4965.  
  4966.  
  4967.     DWORD WINAPI GetSecurityDescriptorLength (
  4968.         PSECURITY_DESCRIPTOR pSecurityDescriptor
  4969.         );
  4970.  
  4971.  
  4972.     BOOL WINAPI GetSecurityDescriptorControl (
  4973.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  4974.         PSECURITY_DESCRIPTOR_CONTROL pControl,
  4975.         DWORD * lpdwRevision
  4976.         );
  4977.  
  4978.  
  4979.     BOOL WINAPI SetSecurityDescriptorDacl (
  4980.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  4981.         BOOL bDaclPresent,
  4982.         PACL pDacl,
  4983.         BOOL bDaclDefaulted
  4984.         );
  4985.  
  4986.  
  4987.     BOOL WINAPI GetSecurityDescriptorDacl (
  4988.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  4989.         BOOL * lpbDaclPresent,
  4990.         PACL *pDacl,
  4991.         BOOL * lpbDaclDefaulted
  4992.         );
  4993.  
  4994.  
  4995.     BOOL WINAPI SetSecurityDescriptorSacl (
  4996.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  4997.         BOOL bSaclPresent,
  4998.         PACL pSacl,
  4999.         BOOL bSaclDefaulted
  5000.         );
  5001.  
  5002.  
  5003.     BOOL WINAPI GetSecurityDescriptorSacl (
  5004.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5005.         BOOL * lpbSaclPresent,
  5006.         PACL *pSacl,
  5007.         BOOL * lpbSaclDefaulted
  5008.         );
  5009.  
  5010.  
  5011.     BOOL WINAPI SetSecurityDescriptorOwner (
  5012.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5013.         PSID pOwner,
  5014.         BOOL bOwnerDefaulted
  5015.         );
  5016.  
  5017.  
  5018.     BOOL WINAPI GetSecurityDescriptorOwner (
  5019.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5020.         PSID *pOwner,
  5021.         BOOL * lpbOwnerDefaulted
  5022.         );
  5023.  
  5024.  
  5025.     BOOL WINAPI SetSecurityDescriptorGroup (
  5026.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5027.         PSID pGroup,
  5028.         BOOL bGroupDefaulted
  5029.         );
  5030.  
  5031.  
  5032.     BOOL WINAPI GetSecurityDescriptorGroup (
  5033.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5034.         PSID *pGroup,
  5035.         BOOL * lpbGroupDefaulted
  5036.         );
  5037.  
  5038.  
  5039.     BOOL WINAPI CreatePrivateObjectSecurity (
  5040.         PSECURITY_DESCRIPTOR ParentDescriptor,
  5041.         PSECURITY_DESCRIPTOR CreatorDescriptor,
  5042.         PSECURITY_DESCRIPTOR * NewDescriptor,
  5043.         BOOL IsDirectoryObject,
  5044.         HANDLE Token,
  5045.         PGENERIC_MAPPING GenericMapping
  5046.         );
  5047.  
  5048.  
  5049.     BOOL WINAPI SetPrivateObjectSecurity (
  5050.         SECURITY_INFORMATION SecurityInformation,
  5051.         PSECURITY_DESCRIPTOR ModificationDescriptor,
  5052.         PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
  5053.         PGENERIC_MAPPING GenericMapping,
  5054.         HANDLE Token
  5055.         );
  5056.  
  5057.  
  5058.     BOOL WINAPI GetPrivateObjectSecurity (
  5059.         PSECURITY_DESCRIPTOR ObjectDescriptor,
  5060.         SECURITY_INFORMATION SecurityInformation,
  5061.         PSECURITY_DESCRIPTOR ResultantDescriptor,
  5062.         DWORD  DescriptorLength,
  5063.         PDWORD ReturnLength
  5064.         );
  5065.  
  5066.  
  5067.     BOOL WINAPI DestroyPrivateObjectSecurity (
  5068.         PSECURITY_DESCRIPTOR * ObjectDescriptor
  5069.         );
  5070.  
  5071.  
  5072.     BOOL WINAPI MakeSelfRelativeSD (
  5073.         PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
  5074.         PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
  5075.         DWORD * lpdwBufferLength
  5076.         );
  5077.  
  5078.  
  5079.     BOOL WINAPI MakeAbsoluteSD (
  5080.         PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
  5081.         PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
  5082.         DWORD * lpdwAbsoluteSecurityDescriptorSize,
  5083.         PACL pDacl,
  5084.         DWORD * lpdwDaclSize,
  5085.         PACL pSacl,
  5086.         DWORD * lpdwSaclSize,
  5087.         PSID pOwner,
  5088.         DWORD * lpdwOwnerSize,
  5089.         PSID pPrimaryGroup,
  5090.         DWORD * lpdwPrimaryGroupSize
  5091.         );
  5092.  
  5093.  
  5094.     BOOL WINAPI SetFileSecurityA (
  5095.         LPCTSTR lpFileName,
  5096.         SECURITY_INFORMATION SecurityInformation,
  5097.         PSECURITY_DESCRIPTOR pSecurityDescriptor
  5098.         );
  5099.  
  5100.     BOOL WINAPI GetFileSecurityA (
  5101.         LPCTSTR lpFileName,
  5102.         SECURITY_INFORMATION RequestedInformation,
  5103.         PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5104.         DWORD nLength,
  5105.         DWORD * lpnLengthNeeded
  5106.         );
  5107.  
  5108.     BOOL WINAPI SetKernelObjectSecurity (
  5109.         HANDLE Handle,
  5110.         SECURITY_INFORMATION SecurityInformation,
  5111.         PSECURITY_DESCRIPTOR SecurityDescriptor
  5112.         );
  5113.     */
  5114.  
  5115.     [
  5116.     usesgetlasterror,
  5117.     #ifdef UNICODE
  5118.     entry("FindFirstChangeNotificationW"),
  5119.     #else
  5120.     entry("FindFirstChangeNotificationA"),
  5121.     #endif
  5122.     helpstring("Sets initial change notification filter conditions and returns handle to wait for change matching the filter conditions occurs in the specified directory or subtree"),
  5123.     ]
  5124.     HANDLE WINAPI FindFirstChangeNotification(
  5125.         LPCTSTR lpPathName,
  5126.         BOOL bWatchSubtree,
  5127.         EFILE_NOTIFY dwNotifyFilter
  5128.         );
  5129.  
  5130.     [
  5131.     usesgetlasterror,
  5132.     entry("FindNextChangeNotification"),
  5133.     helpstring("Requests change notification for next file event matching previously set filter conditions associated handle"),
  5134.     ]
  5135.     BOOL WINAPI FindNextChangeNotification(
  5136.         HANDLE hChangeHandle
  5137.         );
  5138.  
  5139.     [
  5140.     usesgetlasterror,
  5141.     entry("FindCloseChangeNotification"),
  5142.     helpstring("Stops file change notification filtering for the handle"),
  5143.     ]
  5144.     BOOL WINAPI FindCloseChangeNotification(
  5145.         HANDLE hChangeHandle
  5146.         );
  5147.  
  5148.     /*
  5149.     BOOL WINAPI VirtualLock(LPVOID lpAddress, DWORD dwSize);
  5150.     BOOL WINAPI VirtualUnlock(LPVOID lpAddress, DWORD dwSize);
  5151.     */
  5152.  
  5153.     [
  5154.     usesgetlasterror,
  5155.     entry("MapViewOfFileEx"),
  5156.     helpstring("Opens view of specified file mapping at suggested address"),
  5157.     ]
  5158.     LONG WINAPI MapViewOfFileEx(
  5159.         HANDLE hFileMappingObject,
  5160.         DWORD dwDesiredAccess,
  5161.         DWORD dwFileOffsetHigh,
  5162.         DWORD dwFileOffsetLow,
  5163.         DWORD dwNumberOfBytesToMap,
  5164.         LPVOID lpBaseAddress
  5165.         );
  5166.  
  5167.     /*
  5168.     BOOL WINAPI SetPriorityClass(
  5169.         HANDLE hProcess,
  5170.         DWORD  dwPriorityClass
  5171.         );
  5172.  
  5173.     DWORD WINAPI GetPriorityClass(
  5174.         HANDLE hProcess
  5175.         );
  5176.  
  5177.     BOOL WINAPI IsBadReadPtr(
  5178.         CONST void *lp,
  5179.         UINT ucb
  5180.         );
  5181.  
  5182.     BOOL WINAPI IsBadWritePtr(
  5183.         LPVOID lp,
  5184.         UINT ucb
  5185.         );
  5186.  
  5187.     BOOL WINAPI IsBadHugeReadPtr(
  5188.         CONST void *lp,
  5189.         UINT ucb
  5190.         );
  5191.  
  5192.     BOOL WINAPI IsBadHugeWritePtr(
  5193.         LPVOID lp,
  5194.         UINT ucb
  5195.         );
  5196.  
  5197.     BOOL WINAPI IsBadCodePtr(
  5198.         FARPROC lpfn
  5199.         );
  5200.  
  5201.     BOOL WINAPI IsBadStringPtrA(
  5202.         LPCTSTR lpsz,
  5203.         UINT ucchMax
  5204.         );
  5205.     */
  5206.  
  5207.     /*
  5208.     BOOL WINAPI LookupAccountSidA(
  5209.         LPCTSTR lpSystemName,
  5210.         PSID Sid,
  5211.         LPTSTR Name,
  5212.         DWORD * cbName,
  5213.         LPTSTR ReferencedDomainName,
  5214.         DWORD * cbReferencedDomainName,
  5215.         PSID_NAME_USE peUse
  5216.         );
  5217.  
  5218.     BOOL WINAPI LookupAccountNameA(
  5219.         LPCTSTR lpSystemName,
  5220.         LPCTSTR lpAccountName,
  5221.         PSID Sid,
  5222.         DWORD * cbSid,
  5223.         LPTSTR ReferencedDomainName,
  5224.         DWORD * cbReferencedDomainName,
  5225.         PSID_NAME_USE peUse
  5226.         );
  5227.  
  5228.     BOOL WINAPI LookupPrivilegeValueA(
  5229.         LPCTSTR lpSystemName,
  5230.         LPCTSTR lpName,
  5231.         PLUID   lpLuid
  5232.         );
  5233.  
  5234.     BOOL WINAPI LookupPrivilegeNameA(
  5235.         LPCTSTR lpSystemName,
  5236.         PLUID   lpLuid,
  5237.         LPTSTR lpName,
  5238.         DWORD * cbName
  5239.         );
  5240.  
  5241.     BOOL WINAPI LookupPrivilegeDisplayNameA(
  5242.         LPCTSTR lpSystemName,
  5243.         LPCTSTR lpName,
  5244.         LPTSTR lpDisplayName,
  5245.         DWORD * cbDisplayName,
  5246.         DWORD * lpLanguageId
  5247.         );
  5248.  
  5249.     BOOL WINAPI AllocateLocallyUniqueId(
  5250.         PLUID Luid
  5251.         );
  5252.     */
  5253.  
  5254.     /*
  5255.     BOOL
  5256.     WINAPI
  5257.     BuildCommDCBA(
  5258.         LPCTSTR lpDef,
  5259.         LPDCB lpDCB
  5260.         );
  5261.  
  5262.     BOOL
  5263.     WINAPI
  5264.     BuildCommDCBAndTimeoutsA(
  5265.         LPCTSTR lpDef,
  5266.         LPDCB lpDCB,
  5267.         LPCOMMTIMEOUTS lpCommTimeouts
  5268.         );
  5269.  
  5270.     BOOL
  5271.     WINAPI
  5272.     CommConfigDialogA(
  5273.         LPCTSTR lpszName,
  5274.         HWND hWnd,
  5275.         LPCOMMCONFIG lpCC
  5276.         );
  5277.  
  5278.     BOOL
  5279.     WINAPI
  5280.     GetDefaultCommConfigA(
  5281.         LPCTSTR lpszName,
  5282.         LPCOMMCONFIG lpCC,
  5283.         LPDWORD lpdwSize
  5284.         );
  5285.  
  5286.     BOOL
  5287.     WINAPI
  5288.     SetDefaultCommConfigA(
  5289.         LPCTSTR lpszName,
  5290.         LPCOMMCONFIG lpCC,
  5291.         DWORD dwSize
  5292.         );
  5293.     */
  5294.  
  5295.     [
  5296.     usesgetlasterror,
  5297.     #ifdef UNICODE
  5298.     entry("GetComputerNameW"),
  5299.     #else
  5300.     entry("GetComputerNameA"),
  5301.     #endif
  5302.     helpstring("Gets the computer (machine) name"),
  5303.     ]
  5304.     BOOL WINAPI GetComputerName(LPTSTR lpBuffer,
  5305.                                 DWORD * nSize);
  5306.  
  5307.     [
  5308.     usesgetlasterror,
  5309.     #ifdef UNICODE
  5310.     entry("SetComputerNameW"),
  5311.     #else
  5312.     entry("SetComputerNameA"),
  5313.     #endif
  5314.     helpstring("Sets the computer (machine) name"),
  5315.     ]
  5316.     BOOL WINAPI SetComputerName(LPCTSTR lpComputerName);
  5317.  
  5318.     /* This was in WINBASE.H, but DLL is ADVAPI so moved to WINREG.IDL
  5319.     [
  5320.     usesgetlasterror,
  5321.     #ifdef UNICODE
  5322.     entry("GetUserNameW"),
  5323.     #else
  5324.     entry("GetUserNameA"),
  5325.     #endif
  5326.     helpstring(""),
  5327.     ]
  5328.     BOOL WINAPI GetUserName(LPTSTR lpBuffer, LPDWORD nSize);
  5329.     */
  5330.  
  5331.     // Logon Support APIs
  5332.  
  5333.     /*
  5334.     BOOL
  5335.     WINAPI
  5336.     LogonUserA (
  5337.         LPTSTR lpszUsername,
  5338.         LPTSTR lpszDomain,
  5339.         LPTSTR lpszPassword,
  5340.         DWORD dwLogonType,
  5341.         DWORD dwLogonProvider,
  5342.         PHANDLE phToken
  5343.         );
  5344.  
  5345.     BOOL
  5346.     WINAPI
  5347.     ImpersonateLoggedOnUser(
  5348.         HANDLE  hToken
  5349.         );
  5350.  
  5351.     BOOL
  5352.     WINAPI
  5353.     CreateProcessAsUserA (
  5354.         HANDLE hToken,
  5355.         LPCTSTR lpApplicationName,
  5356.         LPTSTR lpCommandLine,
  5357.         LPSECURITY_ATTRIBUTES lpProcessAttributes,
  5358.         LPSECURITY_ATTRIBUTES lpThreadAttributes,
  5359.         BOOL bInheritHandles,
  5360.         DWORD dwCreationFlags,
  5361.         LPVOID lpEnvironment,
  5362.         LPCTSTR lpCurrentDirectory,
  5363.         LPSTARTUPINFOA lpStartupInfo,
  5364.         LPPROCESS_INFORMATION lpProcessInformation
  5365.         );
  5366.     */
  5367.  
  5368.     // Performance counter 
  5369.  
  5370.     [
  5371.     usesgetlasterror,
  5372.     entry("QueryPerformanceCounter"),
  5373.     helpstring("Retrieves value of the high-resolution performance counter"),
  5374.     ]
  5375.     BOOL WINAPI QueryPerformanceCounter(LPVOID lpPerformanceCount);
  5376.  
  5377.     [
  5378.     usesgetlasterror,
  5379.     entry("QueryPerformanceFrequency"),
  5380.     helpstring("Retrieves frequency of the high-resolution performance counter"),
  5381.     ]
  5382.     BOOL WINAPI QueryPerformanceFrequency(LPVOID lpFrequency);
  5383.  
  5384.     [
  5385.     usesgetlasterror,
  5386.     #ifdef UNICODE
  5387.     entry("GetVersionExW"),
  5388.     #else
  5389.     entry("GetVersionExA"),
  5390.     #endif
  5391.     helpstring("Gets Windows version information"),
  5392.     ]
  5393.     BOOL WINAPI GetVersionEx(OSVERSIONINFO * lpVersionInformation);
  5394.  
  5395.     // Power Management APIs
  5396.  
  5397.     /*
  5398.     BOOL WINAPI GetSystemPowerStatus(SYSTEM_POWER_STATUS * lpSystemPowerStatus);
  5399.  
  5400.     BOOL WINAPI SetSystemPowerState(BOOL fSuspend, BOOL fForce);
  5401.     */
  5402.  
  5403. }
  5404.